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

[bug] need to handle refresh the balance when any transaction is completed #1290

Closed
1 task done
Sachidanand-shah opened this issue Jun 13, 2023 · 3 comments · Fixed by #1717
Closed
1 task done

[bug] need to handle refresh the balance when any transaction is completed #1290

Sachidanand-shah opened this issue Jun 13, 2023 · 3 comments · Fixed by #1717

Comments

@Sachidanand-shah
Copy link

Sachidanand-shah commented Jun 13, 2023

Is there an existing issue for this?

  • I have searched the existing issues

RainbowKit Version

0.8.0

wagmi Version

0.11.4

Current Behavior

i have added ConnectButton in Navbar using react app, navbar render only once when app is started,
what happen whenever i'm doing any transaction using MetaMask balance is not updating inside ConnectButton component

Expected Behavior

you have to re-render that component whenever any changes happen in MetaMask wallet

Steps To Reproduce

No response

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

No response

Anything else?

No response

@Sachidanand-shah Sachidanand-shah changed the title [bug] <title> [bug] need to handle refresh the balance when any transaction is compleated Jun 13, 2023
@Sachidanand-shah Sachidanand-shah changed the title [bug] need to handle refresh the balance when any transaction is compleated [bug] need to handle refresh the balance when any transaction is completed Jun 14, 2023
@0xartcro
Copy link
Contributor

0xartcro commented Jul 5, 2023

I could work on that, any tips where to start?

@Sachidanand-shah
Copy link
Author

Sachidanand-shah commented Jul 5, 2023

You need re-render the ConnectButton component whenever any transaction happen;
you can create method like connect, disconnect which is provided by wagmi;
created method name should refreshBalance
in may case ConnectButton is Child component

@DanielSinclair DanielSinclair linked a pull request Jul 18, 2023 that will close this issue
@DanielSinclair
Copy link
Contributor

DanielSinclair commented Jul 18, 2023

Opened #1415 to implement this behavior with Wagmi's balance polling behavior. Feel free to test it out here

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