From c3c77357c26652219e4e9b584d493dab9fd7dfdf Mon Sep 17 00:00:00 2001 From: viet-nv Date: Wed, 9 Oct 2024 10:52:01 +0700 Subject: [PATCH] fix: cant switch network to ethereum --- src/hooks/index.ts | 2 +- src/hooks/web3/useChangeNetwork.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 013c7630a9..37d2fa6cf6 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -94,7 +94,7 @@ export function useWeb3React() { return useMemo( () => ({ account: account.address, - chainId: account.chainId ?? ChainId.MAINNET, + chainId: account.chainId, provider: wrappedProvider, library: wrappedProvider, connector: account.connector, diff --git a/src/hooks/web3/useChangeNetwork.ts b/src/hooks/web3/useChangeNetwork.ts index 00e443416b..eddcaaa098 100644 --- a/src/hooks/web3/useChangeNetwork.ts +++ b/src/hooks/web3/useChangeNetwork.ts @@ -133,7 +133,7 @@ export function useChangeNetwork() { const wrappedSuccessCallback = () => successCallback(desiredChainId, waitUtilUpdatedChainId, customSuccessCallback) // if connected, nothing todo, success return - if (desiredChainId === chainId && !isWrongNetwork) { + if (desiredChainId === chainId && kyberChainId === chainId && !isWrongNetwork) { customSuccessCallback?.() return }