1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00

[PS-1134] Folder fixes, including revamped auth logic (#3118)

This commit is contained in:
Oscar Hinton
2022-07-18 14:39:12 +02:00
committed by GitHub
parent cd5aef1757
commit fbff2e5f00
11 changed files with 65 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
import { Injectable } from "@angular/core";
import { from, mergeMap, Observable } from "rxjs";
import { firstValueFrom, from, mergeMap, Observable } from "rxjs";
import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
import { CollectionService } from "@bitwarden/common/abstractions/collection.service";
@@ -90,7 +90,7 @@ export class VaultFilterService {
return await this.policyService.policyAppliesToUser(PolicyType.PersonalOwnership);
}
protected async getAllFoldersNested(folders?: FolderView[]): Promise<TreeNode<FolderView>[]> {
protected async getAllFoldersNested(folders: FolderView[]): Promise<TreeNode<FolderView>[]> {
const nodes: TreeNode<FolderView>[] = [];
folders.forEach((f) => {
const folderCopy = new FolderView();
@@ -103,7 +103,9 @@ export class VaultFilterService {
}
async getFolderNested(id: string): Promise<TreeNode<FolderView>> {
const folders = await this.getAllFoldersNested();
const folders = await this.getAllFoldersNested(
await firstValueFrom(this.folderService.folderViews$)
);
return ServiceUtils.getTreeNodeObject(folders, id) as TreeNode<FolderView>;
}
}

View File

@@ -223,7 +223,6 @@ export const LOG_MAC_FAILURES = new InjectionToken<string>("LOG_MAC_FAILURES");
I18nServiceAbstraction,
CipherServiceAbstraction,
StateServiceAbstraction,
BroadcasterServiceAbstraction,
],
},
{