Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridge-ui): mobile issues #13927

Merged
merged 29 commits into from
Jun 9, 2023
Merged

fix(bridge-ui): mobile issues #13927

merged 29 commits into from
Jun 9, 2023

Conversation

jscriptcoder
Copy link
Contributor

@jscriptcoder jscriptcoder commented Jun 8, 2023

Where to test:
https://bridge-ui-a3-git-removemetamaskfrommobiles-taikoxyz.vercel.app/

What's done here:

  1. Removed MetaMask connector for mobile/tablet devices. Provider ethereum is simply not injected there. Better to use WalletConnect which will interact with the mobile MetaMask
  2. Removed the use of injected provider to get the signer. This was causing most of the issues in mobile.
  3. Use fetchSigner() provided by wagmi to get the signer instead.
  4. Move the logic to set the signer and chains to the watcher callback.
  5. Refactored the way we switch networks. In mobile there are some race condition issues because of the way the UI is updated from the stores.
  6. Unit tested switchNetwork new function.
  7. Guarding the Add Token to Wallet feature since it uses the injected provider to do so

@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Merging #13927 (1c8f268) into main (9d0a502) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main   #13927   +/-   ##
=======================================
  Coverage   51.78%   51.78%           
=======================================
  Files         146      146           
  Lines        3816     3816           
  Branches      335      336    +1     
=======================================
  Hits         1976     1976           
  Misses       1726     1726           
  Partials      114      114           
Flag Coverage Δ *Carryforward flag
bridge-ui 94.43% <100.00%> (ø)
eventindexer 77.28% <ø> (ø) Carriedforward from 63a8a01
protocol 0.00% <ø> (ø) Carriedforward from 63a8a01
relayer 59.57% <ø> (ø) Carriedforward from 63a8a01
ui 100.00% <ø> (ø) Carriedforward from 63a8a01

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
packages/bridge-ui/src/utils/mintERC20.ts 100.00% <ø> (ø)
packages/protocol/contracts/bridge/Bridge.sol 0.00% <ø> (ø)
...ackages/protocol/contracts/bridge/BridgedERC20.sol 0.00% <ø> (ø)
packages/protocol/contracts/bridge/EtherVault.sol 0.00% <ø> (ø)
packages/protocol/contracts/bridge/TokenVault.sol 0.00% <ø> (ø)
...protocol/contracts/bridge/libs/LibBridgeInvoke.sol 0.00% <ø> (ø)
...rotocol/contracts/bridge/libs/LibBridgeProcess.sol 0.00% <ø> (ø)
...rotocol/contracts/bridge/libs/LibBridgeRelease.sol 0.00% <ø> (ø)
.../protocol/contracts/bridge/libs/LibBridgeRetry.sol 0.00% <ø> (ø)
...s/protocol/contracts/bridge/libs/LibBridgeSend.sol 0.00% <ø> (ø)
... and 3 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jscriptcoder jscriptcoder marked this pull request as ready for review June 9, 2023 13:12
davidtaikocha
davidtaikocha previously approved these changes Jun 9, 2023
d1onys1us
d1onys1us previously approved these changes Jun 9, 2023
@dantaik dantaik added this pull request to the merge queue Jun 9, 2023
Merged via the queue into main with commit 2cb5125 Jun 9, 2023
10 checks passed
@dantaik dantaik deleted the remove_metamask_from_mobiles branch June 9, 2023 14:04
@github-actions github-actions bot mentioned this pull request Jun 9, 2023
dantaik pushed a commit that referenced this pull request Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants