Closed rin-st closed 2 weeks ago
The bug is not related to the mentioned PR, it also works on main
Thanks @rin-st!! So the summary is that if this problem occurs people need to make sure they close all other browser TABs with http://localhost:3000
and then refresh the latest one and it should start working. Just tried this and works nicely.
Umm I think instead of relying on usehooks-ts useLocalStorage
logic maybe we should write a our custom simple logic for DebugContracts.
The reason I feel usehooks useLocalstorage
have this problem is because they are listening to localstroage for all tabs and keeping them in sync :
But since the outdated tab doesn't have the new contract name, it updates the contractName to contractName[0] in outdated tab and latest tab listen to those changes and also updates it.
Is there an existing issue for this?
Which method was used to setup Scaffold-ETH 2 ?
git clone
Current Behavior
While working on https://github.com/scaffold-eth/scaffold-eth-2/pull/933 I found very strange behavior: whenever I click on tab with contract, it always change to
YourContract
tab.https://github.com/user-attachments/assets/0b67d24f-dcb2-4b53-b0f2-771051dedb43
It's not because of its index or alphabetical order, it's always
YourContract
(if you have that tab, of course). Clearing localstorage doesn't helpExpected Behavior
Clicked contract tab should be chosen
Steps To Reproduce
I debugged it and understood that it was because of my other browser tab, which had only
YourContract
. So, steps:yarn deploy --reset
your contracts (or justyarn deploy
if you re-runyarn chain
)yarn start
your appAnything else?
Not sure if we need to fix it for now since it's relatively rare case and not so easy to fix. But at least we know what causes this