We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c55e0a commit b39249eCopy full SHA for b39249e
.changeset/curvy-phones-agree.md
@@ -0,0 +1,6 @@
1
+---
2
+"@web3-ui/hooks": patch
3
4
+
5
+closes #273
6
+fix: save chainId on chainChanged event without formatting
packages/hooks/src/Provider.tsx
@@ -119,7 +119,7 @@ export const Provider: React.FC<ProviderProps> = ({
119
setConnected(true);
120
121
connection.on('chainChanged', async (newChainId: string) => {
122
- const formattedChainId = +newChainId.split('0x')[1];
+ const formattedChainId = +newChainId;
123
setChainId(formattedChainId);
124
setCorrectNetwork(formattedChainId === network);
125
const provider = new ethers.providers.Web3Provider(connection);
0 commit comments