Skip to content

Commit

Permalink
network switching issues fix (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA authored Nov 18, 2024
1 parent 54bd4ca commit 7aedb41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/checkout/src/views/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ export const Swap = () => {
return swapTransactions
}

const walletClientChainId = await walletClient.getChainId()
if (walletClientChainId !== chainId) {
await walletClient.switchChain({ id: chainId })
}

const txHash = await sendTransactions({
connector,
walletClient,
Expand Down

0 comments on commit 7aedb41

Please sign in to comment.