From c12932b2a60e5f6bae5627ce881942d26f8feabb Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 21 May 2022 14:27:07 +0100 Subject: [PATCH] switch to imperative try...finally --- src/store/indexeddb-local-backend.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/store/indexeddb-local-backend.ts b/src/store/indexeddb-local-backend.ts index 08a5260ac..a044a95c4 100644 --- a/src/store/indexeddb-local-backend.ts +++ b/src/store/indexeddb-local-backend.ts @@ -412,13 +412,15 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { this.isPersisting = true; } - await Promise.all([ - this.persistUserPresenceEvents(userTuples), - this.persistAccountData(syncData.accountData), - this.persistSyncData(syncData.nextBatch, syncData.roomsData), - ]).finally(() => { + try { + await Promise.all([ + this.persistUserPresenceEvents(userTuples), + this.persistAccountData(syncData.accountData), + this.persistSyncData(syncData.nextBatch, syncData.roomsData), + ]); + } finally { this.isPersisting = false; - }); + } } /**