make getAllDecrypted synchronous
This commit is contained in:
parent
e555536f24
commit
51ee0b065a
|
@ -181,13 +181,10 @@ export class CipherService implements CipherServiceAbstraction {
|
|||
throw new Error('No key.');
|
||||
}
|
||||
|
||||
const promises: any[] = [];
|
||||
const ciphers = await this.getAll();
|
||||
ciphers.forEach((cipher) => {
|
||||
promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
for (let i = 0; i < ciphers.length; i++) {
|
||||
decCiphers.push(await ciphers[i].decrypt());
|
||||
}
|
||||
decCiphers.sort(this.getLocaleSortingFunction());
|
||||
this.decryptedCipherCache = decCiphers;
|
||||
return this.decryptedCipherCache;
|
||||
|
|
|
@ -48,11 +48,9 @@ export class CollectionService implements CollectionServiceAbstraction {
|
|||
return [];
|
||||
}
|
||||
const decCollections: CollectionView[] = [];
|
||||
const promises: Array<Promise<any>> = [];
|
||||
collections.forEach((collection) => {
|
||||
promises.push(collection.decrypt().then((c) => decCollections.push(c)));
|
||||
});
|
||||
await Promise.all(promises);
|
||||
for (let i = 0; i < collections.length; i++) {
|
||||
decCollections.push(await collections[i].decrypt());
|
||||
}
|
||||
return decCollections.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
||||
}
|
||||
|
||||
|
|
|
@ -78,13 +78,10 @@ export class FolderService implements FolderServiceAbstraction {
|
|||
}
|
||||
|
||||
const decFolders: FolderView[] = [];
|
||||
const promises: Array<Promise<any>> = [];
|
||||
const folders = await this.getAll();
|
||||
folders.forEach((folder) => {
|
||||
promises.push(folder.decrypt().then((f) => decFolders.push(f)));
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
for (let i = 0; i < folders.length; i++) {
|
||||
decFolders.push(await folders[i].decrypt());
|
||||
}
|
||||
decFolders.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
||||
|
||||
const noneFolder = new FolderView();
|
||||
|
|
Loading…
Reference in New Issue