Clean up etemplate2 sessions before closing the top level window

This commit is contained in:
hadi 2023-09-22 16:13:40 +02:00
parent 6dd9df24e6
commit 32d3aa51f2
2 changed files with 7 additions and 0 deletions

View File

@ -285,6 +285,9 @@ var etemplate2 = /** @class */ (function () {
this.close_prompt = this._close_changed_prompt.bind(this);
window.addEventListener("beforeunload", this.close_prompt);
}
else if (window == egw_topWindow()) {
window.addEventListener("beforeunload", this.destroy_session);
}
if (this._etemplate_exec_id) {
this.destroy_session = jQuery.proxy(function (ev) {
// need to use async === "keepalive" to run via beforeunload

View File

@ -358,6 +358,10 @@ export class etemplate2
this.close_prompt = this._close_changed_prompt.bind(this);
window.addEventListener("beforeunload", this.close_prompt);
}
else if (window == egw_topWindow())
{
window.addEventListener("beforeunload", this.destroy_session);
}
if (this._etemplate_exec_id)
{
this.destroy_session = jQuery.proxy(function (ev)