diff --git a/src/navigators/PopupWindow.ts b/src/navigators/PopupWindow.ts index e7647323c..b9c21c24d 100644 --- a/src/navigators/PopupWindow.ts +++ b/src/navigators/PopupWindow.ts @@ -49,7 +49,7 @@ export class PopupWindow implements IWindow { this._id = params.id; if (this._id) { - (window as any)["popupCallback_" + params.id!] = this._callback; + (window as any)["popupCallback_" + this._id] = this._callback; } this._popup.focus(); @@ -113,7 +113,10 @@ export class PopupWindow implements IWindow { window.removeEventListener("message", this._messageReceived); - delete (window as any)["popupCallback_" + this._id!]; + if (this._id) { + delete (window as any)["popupCallback_" + this._id]; + } + this._id = undefined; if (this._popup && !keepOpen) { this._popup.close(); diff --git a/src/navigators/RedirectNavigator.ts b/src/navigators/RedirectNavigator.ts index 03d8240dc..a4a859a51 100644 --- a/src/navigators/RedirectNavigator.ts +++ b/src/navigators/RedirectNavigator.ts @@ -26,7 +26,7 @@ export class RedirectNavigator implements INavigator, IWindow { throw new Error("No url provided"); } - window.location[this._redirectMethod!](params.url); + window.location[this._redirectMethod || "assign"](params.url); return { url: window.location.href }; }