Skip to content

Commit

Permalink
Merge pull request #598 from threshold-network/wallet-connection-aler…
Browse files Browse the repository at this point in the history
…t-fix

Fix WalletConnection alert

There was a bug that caused the walletconnection alert to not show up the
second time if the error message stays the same.

This PR fixes that.

To see if it works you can:
1. Click "Connect  Wallet"
2. Choose "WalletConnect"
3. Close the WalletConnect modal with `X` button
4. The "Connection request reset. Please try again" alert should appear in the
top right corner.
5. Close the alert
6. Repeat steps 1-3
7. The "Connection request reset. Please try again" alert should appear again
  • Loading branch information
r-czajkowski authored Sep 12, 2023
2 parents 6b70393 + 779f5ae commit bfa11b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Navbar/WalletConnectionAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const WalletConnectionAlert: FC<{
chainId?: number
}> = ({ account, chainId }) => {
const [hideAlert, setHideAlert] = useState(false)
const { error } = useWeb3React()
const { error, deactivate } = useWeb3React()
const [alertDescription, setAlertDescription] = useState("")

const errorMessage = error?.message
Expand Down Expand Up @@ -46,6 +46,7 @@ const WalletConnectionAlert: FC<{
const resetAlert = () => {
setHideAlert(true)
setAlertDescription("")
deactivate()
}

if (hideAlert) {
Expand Down

0 comments on commit bfa11b9

Please sign in to comment.