Skip to content

Commit

Permalink
fix: use dispatch event to trigger the event storage listener
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbormann committed Sep 18, 2022
1 parent e1f2a88 commit 010690e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hooks/useCardano.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function useCardano() {

const disconnect = useCallback(() => {
setIsConnected(false);
window.dispatchEvent(new Event('storage'));
enabledObserver.set(false);
enabledWalletObserver.set(null);
stakeAddressObserver.set(null);
Expand Down Expand Up @@ -109,6 +110,7 @@ function useCardano() {
checkEnabled();
if (typeof onConnect === 'function') {
setIsConnected(true);
window.dispatchEvent(new Event('storage'));
onConnect();
}
} catch (error) {
Expand Down

0 comments on commit 010690e

Please sign in to comment.