Remove closed tabs from the client-side session

This commit is contained in:
Hadi Nategh 2020-11-02 13:12:31 +01:00
parent 378b3c6eef
commit 082d7fddad

View File

@ -571,6 +571,13 @@ var fw_base = (function(){ "use strict"; return Class.extend(
{ {
app.destroy(); app.destroy();
} }
this.tag.parentFw.tabApps.forEach((a,i)=>{if (a.name == this.tag.appName)
{
this.tag.parentFw.tabApps.splice(i,1);
return;
}});
this.tag.parentFw._setTabAppsSession(this.tag.parentFw.tabApps);
}, },
/** /**
@ -679,6 +686,14 @@ var fw_base = (function(){ "use strict"; return Class.extend(
} }
}, },
_setTabAppsSession: function(_tabApps)
{
if (_tabApps)
{
egw.setSessionItem('api', 'fw_tab_apps', JSON.stringify(_tabApps));
}
},
tabLinkHandler: function(_link, _extra) tabLinkHandler: function(_link, _extra)
{ {
var app = this.parseAppFromUrl(_link); var app = this.parseAppFromUrl(_link);
@ -720,7 +735,7 @@ var fw_base = (function(){ "use strict"; return Class.extend(
internalName: app.appName internalName: app.appName
})); }));
egw.setSessionItem('api', 'fw_tab_apps', JSON.stringify(this.tabApps)); this._setTabAppsSession(this.tabApps);
} }
else else
{ {