Skip to content

Commit

Permalink
Disconnect WalletConnect connection on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
ccali11 committed Jul 28, 2023
1 parent 29aae9c commit d421354
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/web/src/composables/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function useWallet() {
// const { solanaProviderList, sendSolanaTransaction, signSolanaMessage } = useSolana()
const { getTrezorAddress, loginWithTrezor, sendTrezorTransaction, signTrezorMessage } = useTrezor()
const { addAccount, getUser, checkIfSecondaryAddress, checkIfPrimaryUserExists, removeAccount, setUser, setUserAnalytics, setUserAccountBalances, updatePrimaryAddress, user } = useUsers()
const { web3modal, getWalletConnectAddressAndBalance, loginWithWalletConnectV2 } = useWalletConnectV2()
const { web3modal, disconnectWalletConnect, getWalletConnectAddressAndBalance, loginWithWalletConnectV2 } = useWalletConnectV2()

function getColdStorageAddress(provider: ProviderString, currency: Currency = 'ETH') {
if (provider === 'Ledger') {
Expand Down Expand Up @@ -184,6 +184,7 @@ export default function useWallet() {
setSelectedCurrency('')
setPrimaryAddress('')
setUserAnalytics()
await disconnectWalletConnect()
await refreshBreakdown()
// TODO: Fix bug that doesn't allow you to log in without refreshing page after a user logs out
window.location.reload()
Expand Down

0 comments on commit d421354

Please sign in to comment.