mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Revert "make getAllDecrypted synchronous"
This reverts commit 51ee0b065a.
This commit is contained in:
@@ -181,10 +181,13 @@ export class CipherService implements CipherServiceAbstraction {
|
|||||||
throw new Error('No key.');
|
throw new Error('No key.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const promises: any[] = [];
|
||||||
const ciphers = await this.getAll();
|
const ciphers = await this.getAll();
|
||||||
for (let i = 0; i < ciphers.length; i++) {
|
ciphers.forEach((cipher) => {
|
||||||
decCiphers.push(await ciphers[i].decrypt());
|
promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));
|
||||||
}
|
});
|
||||||
|
|
||||||
|
await Promise.all(promises);
|
||||||
decCiphers.sort(this.getLocaleSortingFunction());
|
decCiphers.sort(this.getLocaleSortingFunction());
|
||||||
this.decryptedCipherCache = decCiphers;
|
this.decryptedCipherCache = decCiphers;
|
||||||
return this.decryptedCipherCache;
|
return this.decryptedCipherCache;
|
||||||
|
|||||||
@@ -48,9 +48,11 @@ export class CollectionService implements CollectionServiceAbstraction {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const decCollections: CollectionView[] = [];
|
const decCollections: CollectionView[] = [];
|
||||||
for (let i = 0; i < collections.length; i++) {
|
const promises: Array<Promise<any>> = [];
|
||||||
decCollections.push(await collections[i].decrypt());
|
collections.forEach((collection) => {
|
||||||
}
|
promises.push(collection.decrypt().then((c) => decCollections.push(c)));
|
||||||
|
});
|
||||||
|
await Promise.all(promises);
|
||||||
return decCollections.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
return decCollections.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,10 +78,13 @@ export class FolderService implements FolderServiceAbstraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const decFolders: FolderView[] = [];
|
const decFolders: FolderView[] = [];
|
||||||
|
const promises: Array<Promise<any>> = [];
|
||||||
const folders = await this.getAll();
|
const folders = await this.getAll();
|
||||||
for (let i = 0; i < folders.length; i++) {
|
folders.forEach((folder) => {
|
||||||
decFolders.push(await folders[i].decrypt());
|
promises.push(folder.decrypt().then((f) => decFolders.push(f)));
|
||||||
}
|
});
|
||||||
|
|
||||||
|
await Promise.all(promises);
|
||||||
decFolders.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
decFolders.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
||||||
|
|
||||||
const noneFolder = new FolderView();
|
const noneFolder = new FolderView();
|
||||||
|
|||||||
Reference in New Issue
Block a user