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)
Tue, Oct 22, 8:47 PM
Unknown Object (File)
Tue, Oct 22, 8:47 PM
Unknown Object (File)
Tue, Oct 22, 8:47 PM
F3047317: Screenshot 2024-10-22 at 9.15.40 PM.png
Tue, Oct 22, 6:15 PM
F3047306: after.mp4
Tue, Oct 22, 6:15 PM
F3047299: before.mp4
Tue, Oct 22, 6:15 PM
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