Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/1Hive/quests into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMansour committed Jun 7, 2022
2 parents d9775cb + bb10d92 commit 6cd176e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react-app/src/contexts/wallet.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ function WalletAugmented({ children }: Props) {
};

const changeNetwork = async (newChainId?: number) => {
if (newChainId === chainId) {
return;
}

if (!newChainId) {
newChainId = chainId;
}
if (ethereum) {
if (ethereum && +ethereum.chainId !== newChainId) {
try {
await ethereum.request({
method: 'wallet_switchEthereumChain',
Expand Down Expand Up @@ -129,6 +133,7 @@ function WalletAugmented({ children }: Props) {
}
}
setCurrentChain(newChainId);
window.location.reload();
};

const contextValue = useMemo(
Expand Down

0 comments on commit 6cd176e

Please sign in to comment.