1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-04 05:02:41 +03:00

switch to imperative try...finally

This commit is contained in:
Matthew Hodgson
2022-05-21 14:27:07 +01:00
parent 7ac1d07cc4
commit c12932b2a6

View File

@@ -412,13 +412,15 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend {
this.isPersisting = true; this.isPersisting = true;
} }
try {
await Promise.all([ await Promise.all([
this.persistUserPresenceEvents(userTuples), this.persistUserPresenceEvents(userTuples),
this.persistAccountData(syncData.accountData), this.persistAccountData(syncData.accountData),
this.persistSyncData(syncData.nextBatch, syncData.roomsData), this.persistSyncData(syncData.nextBatch, syncData.roomsData),
]).finally(() => { ]);
} finally {
this.isPersisting = false; this.isPersisting = false;
}); }
} }
/** /**