Skip to content

Commit

Permalink
fix(app): remove wallet data from store
Browse files Browse the repository at this point in the history
  • Loading branch information
Swepool authored and cor committed Jun 8, 2024
1 parent aac38a1 commit 93c69a3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions app/src/lib/wallet/cosmos/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ function createCosmosStore(
disconnect: async () => {
const cosmosWalletId = get({ subscribe }).connectedWallet as CosmosWalletId
console.log("[cosmos] cosmosDisconnectClick", get(cosmosStore))
if (cosmosWalletId && cosmosWalletId === "keplr" && window[cosmosWalletId]) {
await window[cosmosWalletId]?.disable("union-testnet-8")
update(v => ({ ...v, connectedWallet: "none", connectionStatus: "disconnected" }))
}
if (cosmosWalletId && cosmosWalletId === "leap" && window[cosmosWalletId]) {
await window[cosmosWalletId]?.disconnect("union-testnet-8")
update(v => ({ ...v, connectedWallet: "none", connectionStatus: "disconnected" }))
if (cosmosWalletId && window[cosmosWalletId]) {
if (cosmosWalletId === "keplr") {
await window[cosmosWalletId]?.disable("union-testnet-8")
} else if (cosmosWalletId === "leap") {
await window[cosmosWalletId]?.disconnect("union-testnet-8")
}
update(v => ({
...v,
connectedWallet: "none",
connectionStatus: "disconnected",
address: undefined,
rawAddress: undefined
}))
}
}
}
Expand Down

0 comments on commit 93c69a3

Please sign in to comment.