1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

[PS 1504]Windows CLI - JSON Exports Missing Folders (#4113)

* Replace the FolderView from Observable with getAllDecryptedFromState

* Fixing failed test

* Fixing the PR comment on addressing getEncryptedExport

* Fixing the failing test cases

* Adding some unit test to check folder is exported

* Fixing a failing test

* Rename to getAllFromState to conform

* Please rename to getAllFromState to conform test

Co-authored-by: dynwee <onwudiweokeke@gmail.com>
This commit is contained in:
cyprain-okeke
2022-12-14 15:44:10 +01:00
committed by GitHub
parent 3ffeb684a7
commit ac2f171e2c
4 changed files with 92 additions and 6 deletions

View File

@@ -64,6 +64,18 @@ export class FolderService implements InternalFolderServiceAbstraction {
return folders.find((folder) => folder.id === id);
}
async getAllFromState(): Promise<Folder[]> {
const folders = await this.stateService.getEncryptedFolders();
const response: Folder[] = [];
for (const id in folders) {
// eslint-disable-next-line
if (folders.hasOwnProperty(id)) {
response.push(new Folder(folders[id]));
}
}
return response;
}
/**
* @deprecated For the CLI only
* @param id id of the folder