Page MenuHomePhabricator

[native] Resize back after WalletConnect modal closes
ClosedPublic

Authored by ashoat on Tue, Oct 22, 6:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 11:07 AM
Unknown Object (File)
Sat, Nov 2, 9:05 AM
Unknown Object (File)
Thu, Oct 31, 9:38 PM
Unknown Object (File)
Thu, Oct 31, 7:07 AM
Unknown Object (File)
Wed, Oct 30, 8:44 PM
Unknown Object (File)
Wed, Oct 30, 3:42 AM
Unknown Object (File)
Tue, Oct 29, 4:17 PM
Unknown Object (File)
Mon, Oct 28, 6:50 AM
Subscribers

Details

Summary

In part 3 of D11491, I made us ignore walletconnect_modal_update with height: 0 because I wanted to avoid a jitter that occurred before these events came before siwe_closed events.

(That jitter has improved since D11948, but is still there.)

The changes I made in D11491 made us also ignore walletconnect_modal_update events when a wallet was successfully connected. I figured this was a good idea because the WalletConnect modal was always larger than the normal modal.

However, in ENG-9537 I discovered that on Android, the WalletConnect modal was smaller than the normal modal, and our failure to resize after it was closed was causing the button to render almost off-screen.

Screenshot 2024-10-22 at 9.15.40 PM.png (272×1 px, 89 KB)

This diff adds code to differentiate between the two cases of walletconnect_modal_update with height: 0:

  1. The jitter case, where a siwe_closed event will be received within 50ms.
  2. The success case, where we want to resize back to the normal size.

We differentiate these cases by starting a timer, and seeing if the modal was closed within 50ms.

Test Plan

I tested both scenarios on my Android device, with commSIWE hardcoded to point to production. Here's videos of before and after, with me first testing the success case, and then the jitter case. Note that the before video shows the issue with the success case, and that neither the before nor after videos show a jitter when closing the modal.

beforeafter

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable