Skip to content

Commit

Permalink
fix(Account#progressCallback): Don't error if syncProcess is not defi…
Browse files Browse the repository at this point in the history
…ned yet

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed May 11, 2024
1 parent ac0367d commit 418e409
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Account[]> {
Expand Down

0 comments on commit 418e409

Please sign in to comment.