From e3f139f2afaadd85d5f48ceb0344ca8912456118 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 16 Aug 2023 10:23:58 -0600 Subject: [PATCH] Fix canceled close still destroyed session --- api/js/etemplate/etemplate2.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index 0d9eee49c6..ffca459c9e 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -467,7 +467,7 @@ export class etemplate2 [this._etemplate_exec_id], null, null, "keepalive").sendRequest(); }, this); - window.addEventListener("beforeunload", this.destroy_session); + window.addEventListener("unload", this.destroy_session); } } @@ -483,6 +483,7 @@ export class etemplate2 // Chrome requires returnValue to be set e.returnValue = ''; + return ""; } public skip_close_prompt(skip = true)