Sync progress circle

This commit is contained in:
Zef Hemel
2023-06-14 20:58:08 +02:00
parent 604329b02a
commit a2bba5a7ab
6 changed files with 88 additions and 23 deletions
+2 -2
View File
@@ -104,8 +104,8 @@ export class SyncService {
}
async registerSyncProgress(status?: SyncStatus): Promise<void> {
// Emit a sync event at most every 10s
if (status && this.lastReportedSyncStatus < Date.now() - 10000) {
// Emit a sync event at most every 2s
if (status && this.lastReportedSyncStatus < Date.now() - 2000) {
this.eventHook.dispatchEvent("sync:progress", status);
this.lastReportedSyncStatus = Date.now();
await this.saveSnapshot(status.snapshot);