1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

[AC-1139] Fixed CanDelete logic

This commit is contained in:
Rui Tome
2023-11-21 10:21:10 +00:00
parent 12a76a1818
commit 572e6e7ee2
3 changed files with 15 additions and 6 deletions

View File

@@ -316,6 +316,14 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
this.close(CollectionDialogAction.Deleted, this.collection);
};
protected canDelete$ = this.flexibleCollectionsEnabled$.pipe(
switchMap(async (flexibleCollectionsEnabled) => {
return (
this.editMode && this.collection?.canDelete(this.organization!, flexibleCollectionsEnabled)
);
})
);
ngOnDestroy(): void {
this.destroy$.next();
this.destroy$.complete();