From 26186618f5489428c0bcc3a74789236c1f31bd2e Mon Sep 17 00:00:00 2001 From: aj-rosado <109146700+aj-rosado@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:38:35 +0100 Subject: [PATCH] [PM-245] Fixed validation on navigate back on browser send add edit (#9605) * Fixed validation on navigate back on browser send add edit * simplified expression using nullish-resolution --- apps/browser/src/tools/popup/send/send-add-edit.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/tools/popup/send/send-add-edit.component.ts b/apps/browser/src/tools/popup/send/send-add-edit.component.ts index c20bf7cb8de..5ff3621e352 100644 --- a/apps/browser/src/tools/popup/send/send-add-edit.component.ts +++ b/apps/browser/src/tools/popup/send/send-add-edit.component.ts @@ -124,7 +124,8 @@ export class SendAddEditComponent extends BaseAddEditComponent { cancel() { // If true, the window was pop'd out on the add-send page. location.back will not work - if ((window as any).previousPopupUrl.startsWith("/add-send")) { + const isPopup = (window as any)?.previousPopupUrl?.startsWith("/add-send") ?? false; + if (!isPopup) { // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["tabs/send"]);