1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

PM-11338: [Defect] Clicking outside of View {Item} dialog should close the dialog properly (#11035)

* Handle undefined result.

* Updated enum values for consistency.
This commit is contained in:
Alec Rippberger
2024-09-18 16:02:47 -05:00
committed by GitHub
parent 6c1d74a4ce
commit 2b85392b0f

View File

@@ -886,13 +886,13 @@ export class VaultComponent implements OnInit, OnDestroy {
const result: ViewCipherDialogCloseResult = await lastValueFrom(dialogRef.closed);
// If the dialog was closed by deleting the cipher, refresh the vault.
if (result.action === ViewCipherDialogResult.Deleted) {
if (result?.action === ViewCipherDialogResult.Deleted) {
this.refresh();
this.go({ cipherId: null, itemId: null, action: null });
}
// If the dialog was closed by any other action (close button, escape key, etc), navigate back to the vault.
if (!result.action) {
if (!result?.action) {
this.go({ cipherId: null, itemId: null, action: null });
}
}