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

How to handle changes in the isConnected state. #2152

Open
1 task done
lianshao123 opened this issue Aug 21, 2024 · 4 comments
Open
1 task done

How to handle changes in the isConnected state. #2152

lianshao123 opened this issue Aug 21, 2024 · 4 comments

Comments

@lianshao123
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

RainbowKit Version

2.1.3

wagmi Version

2.10.10

Current Behavior

When the wallet is already connected and the page refreshes, the isConnected state in wagmi will change from false to true, which can lead to issues in my application.

Expected Behavior

I want to correctly obtain the current wallet connection status without experiencing multiple changes.

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

@DanielSinclair
Copy link
Collaborator

@lianshao123 Can you share an example of the behavior you're seeing? I would expect isConnected to only remain false until the wallet is detected and Wagmi updates; this should just take a split second.

@lianshao123
Copy link
Author

20240822134220_rec_.mp4

@lianshao123
Copy link
Author

Each time the page is refreshed, this situation occurs. My business needs to interact with the backend based on the current connection status. Different operations will be executed depending on whether the isConnected state is false or true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@DanielSinclair @lianshao123 and others