Skip to content

Commit 677a435

Browse files
prevent showing ssh key when cipher changes in desktop view (#14913)
1 parent 5f169af commit 677a435

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/desktop/src/vault/app/vault/view.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
OnDestroy,
1010
OnInit,
1111
Output,
12+
SimpleChanges,
1213
} from "@angular/core";
1314

1415
import { ViewComponent as BaseViewComponent } from "@bitwarden/angular/vault/components/view.component";
@@ -130,14 +131,20 @@ export class ViewComponent extends BaseViewComponent implements OnInit, OnDestro
130131
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
131132
}
132133

133-
async ngOnChanges() {
134+
async ngOnChanges(changes: SimpleChanges) {
134135
if (this.cipher?.decryptionFailure) {
135136
DecryptionFailureDialogComponent.open(this.dialogService, {
136137
cipherIds: [this.cipherId as CipherId],
137138
});
138139
return;
139140
}
140141
this.passwordReprompted = this.masterPasswordAlreadyPrompted;
142+
143+
if (changes["cipherId"]) {
144+
if (changes["cipherId"].currentValue !== changes["cipherId"].previousValue) {
145+
this.showPrivateKey = false;
146+
}
147+
}
141148
}
142149

143150
viewHistory() {

0 commit comments

Comments
 (0)