diff --git a/app/src/lib/wallet/cosmos/config.ts b/app/src/lib/wallet/cosmos/config.ts index b3b7236f9e..e8971add3c 100644 --- a/app/src/lib/wallet/cosmos/config.ts +++ b/app/src/lib/wallet/cosmos/config.ts @@ -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 + })) } } } diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index 116a635922..63041951ec 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -41,6 +41,8 @@ $: if ( address: $cosmosStore.rawAddress }) } + +$: if ($cosmosStore.connectionStatus === "disconnected") cosmosBalances = null
@@ -98,7 +100,11 @@ $: if ( {#each $cosmosBalances as balance, index}

{$cosmosChains[index].display_name}

-
{rawToBech32($cosmosChains[index].addr_prefix, $cosmosStore.rawAddress)}
+ {#if $cosmosChains[index]?.addr_prefix && $cosmosStore.rawAddress && $cosmosStore.rawAddress.length > 0} +
+ {rawToBech32($cosmosChains[index].addr_prefix, $cosmosStore.rawAddress)} +
+ {/if} {#if balance.isLoading}

Loading...

{:else if balance.isError}