Page MenuHomePhabricator

[landing] Use connectModalOpen exposed by RainbowKit
ClosedPublic

Authored by ashoat on May 8 2024, 12:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 9, 7:49 AM
Unknown Object (File)
Mon, Sep 9, 7:49 AM
Unknown Object (File)
Mon, Sep 9, 7:49 AM
Unknown Object (File)
Mon, Sep 9, 7:49 AM
Unknown Object (File)
Aug 27 2024, 4:43 AM
Unknown Object (File)
Aug 20 2024, 6:08 AM
Unknown Object (File)
Aug 20 2024, 2:30 AM
Unknown Object (File)
Aug 20 2024, 1:31 AM
Subscribers

Details

Summary

When we initially introduced this, I wasn't able to find any place where connectModalOpen was exposed, so we patched RainbowKit to expose useModalState. The value of connectModalOpen there turns to false when the WalletConnect modal is opened, so we had to add some hacks for it to work correctly.

It looks like now RainbowKit exposes connectModalOpen to consumers of the library. On top of that, the value of this connectModalOpen actually does not turn to false when the WalletConnect modal opens, so it lets us simplify some of our logic and get rid of some hacks.

This also solves ENG-8043, which occurred because the timeout in the old hacky code could be exceeded.

Test Plan

In my iOS simulator:

  1. I logged the values of the old connectModalOpen and the new one side-by-side and saw what the values were (I had to forward the message from landing to native)
  2. I tested several scenarios of closing/opening parts of the modal:
    • Open the WalletConnect modal
    • Open the QR code in the WalletConnect modal
    • Go back from the QR code
    • Go back from the WalletConnect modal
    • Close the modal by pressing the "X"
    • Successfully auth

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable