WalletConnect / web3modal-react-native

Web3Modal React-Native SDK
https://web3modal.com
Apache License 2.0
43 stars 14 forks source link

[bug] React Native - The app cannot select a network and fails to remember account details upon reopening. #156

Closed tomheo11233aA closed 2 months ago

tomheo11233aA commented 2 months ago

Link to minimal reproducible example

https://github.com/tomheo11233aA/Web3SampleApp.git

Summary

1. When connect wallet successfully I using select network tab and have a

Console Warning: Possible unhandled promise rejection: SwitchChainError: An error occurred when attempting to switch chain.

2. When reopen app ( destroy app and open again )

List of related npm package versions

"web3": "^4.7.0"
"wagmi": "^1.4.13"
"viem": "^1.21.4"
"@web3modal/coinbase-wagmi-react-native": "^1.3.0"
"@web3modal/wagmi-react-native": "^1.3.0"
"react-native": "0.73.6"
"@react-native-async-storage/async-storage": "^1.23.1"
linear[bot] commented 2 months ago

W3M-237 [bug] React Native - The app cannot select a network and fails to remember account details upon reopening.

ignaciosantise commented 2 months ago

Hey @tomheo11233aA 👋 thanks for reporting.

Can you provide steps to reproduce the issue? Also:

tomheo11233aA commented 2 months ago

Hello @ignaciosantise, thank you for your support.

tomheo11233aA commented 2 months ago

@ignaciosantise Hello. I believe this bug has been fixed. Thank you for your support.

ignaciosantise commented 2 months ago

@tomheo11233aA great! Did you change anything on your side to fix it? If so, can you write it here so future devs can read it

tomheo11233aA commented 2 months ago

@ignaciosantise I didn't reinstall the library or make any changes; I simply ran the app again, and unexpectedly, there were no problems.

socheatleang commented 1 month ago

Hello @ignaciosantise @tomheo11233aA . Actually. It's the problem. I am using react-native expo which integrate the latest version of "@web3modal/wagmi-react-native": "^1.3.0". The step to reproduce.

  1. Connect with one wallet (metamask, trust, etc...)
  2. Terminate the app
  3. Disconnect with connected wallet
  4. Try to connect the wallet again Then the error would say that it's still active which lead my user can't connect to the wallet.

To temporary solved this issue, I would need to code AsyncStorage.clear();

ignaciosantise commented 1 month ago

@socheatleang your issue is not related to this one. Can you create a new one? And please add a video so i can understand the issue better 🙏