From 36633dfbcb99d1a38e643fc34bd369521b43af1f Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 23 Feb 2025 14:13:40 +0000 Subject: [PATCH] Add comments --- frontend/sync-client/src/sync-client.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/sync-client/src/sync-client.ts b/frontend/sync-client/src/sync-client.ts index 8cac7fa2..7361c73c 100644 --- a/frontend/sync-client/src/sync-client.ts +++ b/frontend/sync-client/src/sync-client.ts @@ -67,6 +67,7 @@ export class SyncClient { settings: undefined, database: undefined }; + const database = new Database( logger, state.database, @@ -136,6 +137,9 @@ export class SyncClient { return this._syncService.checkConnection(); } + /// Wait for the in-flight operations to finish, reset all tracking, + /// and the local database but retain the settings. + /// The SyncClient can be used again after calling this method. public async reset(): Promise { await this._syncer.reset(); this._history.reset(); @@ -143,6 +147,7 @@ export class SyncClient { this.logger.reset(); } + /// Clear all global state that has been touched by SyncClient. public stop(): void { if (this.remoteListenerIntervalId !== null) { clearInterval(this.remoteListenerIntervalId);