Commit 1b91e7ce authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

fix: Revert "refactor: remove coinbase wallet resetState" (#4081)

Revert "refactor: remove coinbase wallet resetState (#4024)"

This reverts commit e36722cc.
parent 535e670c
import { Trans } from '@lingui/macro'
import { useWeb3React } from '@web3-react/core'
import CopyHelper from 'components/AccountDetails/Copy'
import { injectedConnection } from 'connection'
import { coinbaseWalletConnection, injectedConnection } from 'connection'
import { getConnection } from 'connection/utils'
import { useCallback, useContext } from 'react'
import { ExternalLink as LinkIcon } from 'react-feather'
......@@ -257,6 +257,13 @@ export default function AccountDetails({
onClick={() => {
if (connector.deactivate) {
connector.deactivate()
// Coinbase Wallet SDK does not emit a disconnect event to the provider,
// which is what web3-react uses to reset state. As a workaround we manually
// reset state.
if (connector === coinbaseWalletConnection.connector) {
connector.resetState()
}
} else {
connector.resetState()
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment