1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-11 10:10:25 +01: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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -886,13 +886,13 @@ export class VaultComponent implements OnInit, OnDestroy {
const result: ViewCipherDialogCloseResult = await lastValueFrom(dialogRef.closed); const result: ViewCipherDialogCloseResult = await lastValueFrom(dialogRef.closed);
// If the dialog was closed by deleting the cipher, refresh the vault. // 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.refresh();
this.go({ cipherId: null, itemId: null, action: null }); 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 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 }); this.go({ cipherId: null, itemId: null, action: null });
} }
} }