-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Bugfix | No Issue]
Add useEffect
for when wallet is connected to different network
#2642
[Bugfix | No Issue]
Add useEffect
for when wallet is connected to different network
#2642
Conversation
✅ Deploy Preview for decent-interface-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Da-Colon do we need/want a dependency array for this useEffect
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well for me, thanks @Da-Colon !
@@ -113,7 +113,7 @@ export function EstablishEssentials(props: ICreationStepProps) { | |||
const chainId = getChainIdFromPrefix(addressPrefix); | |||
switchChain({ chainId }); | |||
} | |||
}); | |||
}, [chain.id, walletChainID, addressPrefix, switchChain]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Da-Colon With these deps, I'm worried about what might happen if the user switches their wallet network themselves, resulting in walletChainID
being different from chain.id
(right?), and triggering a call to switchChain
to chainId
from unchanged addressPrefix
Noticed that the wallet wouldn't switch to ethereum on page load and that switching networks via the selection wasn't causing hte network to change