Skip to content

Commit

Permalink
fix: fix connecting wallet issue in refreshing page in swap details
Browse files Browse the repository at this point in the history
  • Loading branch information
samobasquiat committed Apr 28, 2024
1 parent 2220d8f commit 533ab30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions widget/embedded/src/hooks/useBootstrap/useBootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -70,5 +72,5 @@ export function useBootstrap() {
void fetchApiConfig().catch(console.log);

return tabManager.destroy;
}, []);
}, [lastConnectedWalletWithNetwork]);
}

0 comments on commit 533ab30

Please sign in to comment.