Skip to content

Commit

Permalink
fix autosync interval type
Browse files Browse the repository at this point in the history
  • Loading branch information
karolsojko committed Dec 4, 2023
1 parent 7ec4056 commit 0acc30a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/snjs/lib/Services/Sync/SyncService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class SyncService
public lastSyncInvokationPromise?: Promise<unknown>
public currentSyncRequestPromise?: Promise<void>

private declare autoSyncInterval: ReturnType<typeof setInterval>
private autoSyncInterval?: NodeJS.Timer
private wasNotifiedOfItemsChangeOnServer = false

constructor(
Expand Down Expand Up @@ -194,7 +194,9 @@ export class SyncService

public override deinit(): void {
this.dealloced = true
clearInterval(this.autoSyncInterval)
if (this.autoSyncInterval) {
clearInterval(this.autoSyncInterval)
}
;(this.autoSyncInterval as unknown) = undefined
;(this.sessionManager as unknown) = undefined
;(this.itemManager as unknown) = undefined
Expand Down

0 comments on commit 0acc30a

Please sign in to comment.