Skip to content

Commit 6cbc910

Browse files
committed
Ensure syncer intervals are cleared
1 parent 5e1af6e commit 6cbc910

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/stores.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ walletInterface.subscribe((walletInterface: WalletInterface | null) => {
9797
})
9898

9999
export function resetWalletState(options: { disconnected?: boolean } = {}) {
100+
// clear all current intervals if they exist
101+
currentSyncerIntervals.forEach(
102+
(interval: number | undefined) => interval && clearInterval(interval)
103+
)
104+
100105
walletInterface.update((currentInterface: WalletInterface | null) => {
101106
const { disconnected } = options
102107
!disconnected &&

0 commit comments

Comments
 (0)