1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-19 10:54:00 +00:00

remove unarchive button when a cipher is deleted (#18575)

This commit is contained in:
Nick Krantz
2026-01-29 09:58:57 -06:00
committed by jaasen-livefront
parent 681308fe0f
commit 85f9a952cc
2 changed files with 14 additions and 2 deletions

View File

@@ -26,7 +26,7 @@
</button>
}
<ng-container slot="end">
@if ((archiveFlagEnabled$ | async) && cipher.isArchived) {
@if ((archiveFlagEnabled$ | async) && cipher.isArchived && !cipher.isDeleted) {
<button
type="button"
[bitAction]="unarchive"

View File

@@ -469,7 +469,7 @@ describe("ViewV2Component", () => {
describe("unarchive button", () => {
it("shows the unarchive button when the cipher is archived", fakeAsync(() => {
component.cipher = { ...mockCipher, isArchived: true } as CipherView;
component.cipher = { ...mockCipher, isArchived: true, isDeleted: false } as CipherView;
tick();
fixture.detectChanges();
@@ -491,6 +491,18 @@ describe("ViewV2Component", () => {
);
expect(unarchiveBtn).toBeFalsy();
}));
it("does not show the unarchive button when the cipher is deleted", fakeAsync(() => {
component.cipher = { ...mockCipher, isArchived: true, isDeleted: true } as CipherView;
tick();
fixture.detectChanges();
const unarchiveBtn = fixture.debugElement.query(
By.css("button[biticonbutton='bwi-unarchive']"),
);
expect(unarchiveBtn).toBeFalsy();
}));
});
describe("archive", () => {