From 0a7a80d5a8e692123edd7a97df149603cedd4a65 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 2 Nov 2020 17:34:17 +0100 Subject: [PATCH] await idb operations from crypto store for dehydration --- src/crypto/dehydration.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crypto/dehydration.ts b/src/crypto/dehydration.ts index 637fa5ce1..28caaf88d 100644 --- a/src/crypto/dehydration.ts +++ b/src/crypto/dehydration.ts @@ -51,7 +51,7 @@ export class DehydrationManager { this.getDehydrationKeyFromCache(); } async getDehydrationKeyFromCache(): Promise { - return this.crypto._cryptoStore.doTxn( + return await this.crypto._cryptoStore.doTxn( 'readonly', [IndexedDBCryptoStore.STORE_ACCOUNT], (txn) => { @@ -88,7 +88,7 @@ export class DehydrationManager { this.timeoutId = undefined; } // clear storage - this.crypto._cryptoStore.doTxn( + await this.crypto._cryptoStore.doTxn( 'readwrite', [IndexedDBCryptoStore.STORE_ACCOUNT], (txn) => { @@ -135,7 +135,7 @@ export class DehydrationManager { // update the crypto store with the timestamp const key = await encryptAES(encodeBase64(this.key), pickleKey, DEHYDRATION_ALGORITHM); - this.crypto._cryptoStore.doTxn( + await this.crypto._cryptoStore.doTxn( 'readwrite', [IndexedDBCryptoStore.STORE_ACCOUNT], (txn) => {