From 418e409ce7a9b59ccb3b4bf22caeddca1d12f533 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 11 May 2024 13:25:04 +0200 Subject: [PATCH] fix(Account#progressCallback): Don't error if syncProcess is not defined yet Signed-off-by: Marcel Klehr --- src/lib/Account.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/Account.ts b/src/lib/Account.ts index d2b2bd8a86..dbaddd67d0 100644 --- a/src/lib/Account.ts +++ b/src/lib/Account.ts @@ -363,11 +363,14 @@ export default class Account { if (!this.syncing) { return } + await this.setData({ ...this.getData(), syncing: progress }) + if (!this.syncProcess) { + return + } if (actionsDone && (!(this.server instanceof CachingAdapter) || !('onSyncComplete' in this.server))) { await this.storage.setCurrentContinuation(this.syncProcess.toJSON()) await this.syncProcess.getMappingsInstance().persist() } - await this.setData({ ...this.getData(), syncing: progress }) } static async getAllAccounts():Promise {