1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

Revert "make getAllDecrypted synchronous"

This reverts commit 51ee0b065a.
This commit is contained in:
Kyle Spearrin
2018-07-23 14:24:27 -04:00
parent 04014a8e78
commit c7e8f1d13f
3 changed files with 17 additions and 9 deletions

View File

@@ -181,10 +181,13 @@ export class CipherService implements CipherServiceAbstraction {
throw new Error('No key.');
}
const promises: any[] = [];
const ciphers = await this.getAll();
for (let i = 0; i < ciphers.length; i++) {
decCiphers.push(await ciphers[i].decrypt());
}
ciphers.forEach((cipher) => {
promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));
});
await Promise.all(promises);
decCiphers.sort(this.getLocaleSortingFunction());
this.decryptedCipherCache = decCiphers;
return this.decryptedCipherCache;