rainbowkit icon indicating copy to clipboard operation
rainbowkit copied to clipboard

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

Open Sachidanand-shah opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [x] 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 avatar Jun 13 '23 05:06 Sachidanand-shah

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

art-eth avatar Jul 05 '23 12:07 art-eth

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

Sachidanand-shah avatar Jul 05 '23 13:07 Sachidanand-shah

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

DanielSinclair avatar Jul 18 '23 17:07 DanielSinclair