mirror of
https://github.com/bitwarden/browser
synced 2026-01-05 18:13:26 +00:00
Merge branch 'master' into feature/org-admin-refresh
This commit is contained in:
@@ -12,6 +12,7 @@ export abstract class FolderService {
|
||||
clearCache: () => Promise<void>;
|
||||
encrypt: (model: FolderView, key?: SymmetricCryptoKey) => Promise<Folder>;
|
||||
get: (id: string) => Promise<Folder>;
|
||||
getAllFromState: () => Promise<Folder[]>;
|
||||
/**
|
||||
* @deprecated Only use in CLI!
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,8 @@ export abstract class PlatformUtilsService {
|
||||
confirmText?: string,
|
||||
cancelText?: string,
|
||||
type?: string,
|
||||
bodyIsHtml?: boolean
|
||||
bodyIsHtml?: boolean,
|
||||
target?: string
|
||||
) => Promise<boolean>;
|
||||
isDev: () => boolean;
|
||||
isSelfHost: () => boolean;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as papa from "papaparse";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
import { ApiService } from "../abstractions/api.service";
|
||||
import { CipherService } from "../abstractions/cipher.service";
|
||||
@@ -116,7 +115,7 @@ export class ExportService implements ExportServiceAbstraction {
|
||||
const promises = [];
|
||||
|
||||
promises.push(
|
||||
firstValueFrom(this.folderService.folderViews$).then((folders) => {
|
||||
this.folderService.getAllDecryptedFromState().then((folders) => {
|
||||
decFolders = folders;
|
||||
})
|
||||
);
|
||||
@@ -192,7 +191,7 @@ export class ExportService implements ExportServiceAbstraction {
|
||||
const promises = [];
|
||||
|
||||
promises.push(
|
||||
firstValueFrom(this.folderService.folders$).then((f) => {
|
||||
this.folderService.getAllFromState().then((f) => {
|
||||
folders = f;
|
||||
})
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user