Skip to content

Commit 0a972c8

Browse files
authored
fix: cant switch network to ethereum (#2544)
1 parent 55b68df commit 0a972c8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/hooks/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function useWeb3React() {
9494
return useMemo(
9595
() => ({
9696
account: account.address,
97-
chainId: account.chainId ?? ChainId.MAINNET,
97+
chainId: account.chainId,
9898
provider: wrappedProvider,
9999
library: wrappedProvider,
100100
connector: account.connector,

src/hooks/web3/useChangeNetwork.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export function useChangeNetwork() {
133133
const wrappedSuccessCallback = () =>
134134
successCallback(desiredChainId, waitUtilUpdatedChainId, customSuccessCallback)
135135
// if connected, nothing todo, success return
136-
if (desiredChainId === chainId && !isWrongNetwork) {
136+
if (desiredChainId === chainId && kyberChainId === chainId && !isWrongNetwork) {
137137
customSuccessCallback?.()
138138
return
139139
}

0 commit comments

Comments
 (0)