From 73d0dd4c79b4e9ee7444cba05181395050e43bbc Mon Sep 17 00:00:00 2001 From: Dawid Sowa Date: Mon, 13 May 2024 12:55:27 +0200 Subject: [PATCH] fix: remove session when disconnected --- src/connector-extension/connector-extension-client.ts | 3 +++ src/radix-dapp-toolkit.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/connector-extension/connector-extension-client.ts b/src/connector-extension/connector-extension-client.ts index cbe87b26..78dccba6 100644 --- a/src/connector-extension/connector-extension-client.ts +++ b/src/connector-extension/connector-extension-client.ts @@ -259,6 +259,9 @@ export const ConnectorExtensionClient = ( return { send: sendWalletInteraction, + disconnect: () => { + storage.clear() + }, destroy: () => { subscription.unsubscribe() removeEventListener(eventType.incomingMessage, handleIncomingMessage) diff --git a/src/radix-dapp-toolkit.ts b/src/radix-dapp-toolkit.ts index c08f4dfe..bd9db79e 100644 --- a/src/radix-dapp-toolkit.ts +++ b/src/radix-dapp-toolkit.ts @@ -155,6 +155,7 @@ export const RadixDappToolkit = ( if (item.showCancel) walletClient.cancelRequest(item.id) }) stateClient.reset() + connectorExtensionClient.disconnect() walletClient.resetRequestItems() connectButtonClient.disconnect() if (onDisconnect) onDisconnect()