simplified expression using nullish-resolution

This commit is contained in:
Andre Rosado 2024-06-13 17:11:27 +01:00
parent 15211c73fe
commit 6bf1c9d810
No known key found for this signature in database
GPG Key ID: 99F68267CCD45AA9
1 changed files with 2 additions and 4 deletions

View File

@ -124,10 +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 == null ||
!(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"]);