From 533ab3013fbc129d4e2ced02cd593b3bfbf5ea93 Mon Sep 17 00:00:00 2001 From: samobasquiat Date: Sun, 28 Apr 2024 13:08:14 +0000 Subject: [PATCH] fix: fix connecting wallet issue in refreshing page in swap details --- widget/embedded/src/hooks/useBootstrap/useBootstrap.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/widget/embedded/src/hooks/useBootstrap/useBootstrap.ts b/widget/embedded/src/hooks/useBootstrap/useBootstrap.ts index 4cef1a5a26..be09542b3d 100644 --- a/widget/embedded/src/hooks/useBootstrap/useBootstrap.ts +++ b/widget/embedded/src/hooks/useBootstrap/useBootstrap.ts @@ -57,7 +57,9 @@ export function useBootstrap() { * it the future we should add a safer soloution like considering array of handlers . * https://github.com/rango-exchange/rango-client/pull/630/files#r1518846728 */ - widgetContext.onConnectWallet(setLastConnectedWalletWithNetwork); + widgetContext.onConnectWallet((walletType) => { + setLastConnectedWalletWithNetwork(walletType); + }); widgetContext.onDisconnectWallet((walletType) => { setDisconnectedWallet(walletType); if ( @@ -70,5 +72,5 @@ export function useBootstrap() { void fetchApiConfig().catch(console.log); return tabManager.destroy; - }, []); + }, [lastConnectedWalletWithNetwork]); }