mirror of
https://github.com/bitwarden/browser
synced 2026-02-14 23:45:37 +00:00
[PM-31387] Desktop Footer update archive/trash btn values (#18640)
* update footer component when action changes for desktop
This commit is contained in:
@@ -97,7 +97,7 @@ export class ItemFooterComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
async ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes.cipher) {
|
||||
if (changes.cipher || changes.action) {
|
||||
await this.checkArchiveState();
|
||||
}
|
||||
}
|
||||
@@ -255,12 +255,15 @@ export class ItemFooterComponent implements OnInit, OnChanges {
|
||||
this.userCanArchive = userCanArchive;
|
||||
|
||||
this.showArchiveButton =
|
||||
cipherCanBeArchived && userCanArchive && this.action === "view" && !this.cipher.isArchived;
|
||||
cipherCanBeArchived &&
|
||||
userCanArchive &&
|
||||
(this.action === "view" || this.action === "edit") &&
|
||||
!this.cipher.isArchived;
|
||||
|
||||
// A user should always be able to unarchive an archived item
|
||||
this.showUnarchiveButton =
|
||||
hasArchiveFlagEnabled &&
|
||||
this.action === "view" &&
|
||||
(this.action === "view" || this.action === "edit") &&
|
||||
this.cipher.isArchived &&
|
||||
!this.cipher.isDeleted;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user