Fix open compose windows created new drafts after main window was reloaded

This commit is contained in:
nathan 2022-10-05 14:30:43 -06:00
parent 3ce5aebe12
commit ec388c955a
2 changed files with 5 additions and 6 deletions

View File

@ -488,8 +488,7 @@ window.egw_rejoin = function ()
{
opener.addEventListener("load", () =>
{
/* It takes more than just re-setting this.framework to get things working again
/* It takes more than just re-setting this.framework to get everything working again, but this helps */
let reconnecting = egw(this).message("Reconnecting...");
window.setTimeout(() =>
{
@ -499,7 +498,6 @@ window.egw_rejoin = function ()
this.framework = this.opener.framework;
this.framework.egw_appWindow().console.log("Popup %s rejoined", this.location.href);
}, 5000);
*/
});
}.bind(window), 500);
}

View File

@ -3906,9 +3906,10 @@ app.classes.mail = AppJS.extend(
}
else
{
self.egw.json('mail.mail_compose.ajax_saveAsDraft',[content, action],function(_data){
var res = self.savingDraft_response(_data,action);
// Send request through framework main window, so it works even if the main window is reloaded
framework.egw_appWindow().egw.json('mail.mail_compose.ajax_saveAsDraft', [content, action], function (_data)
{
var res = self.savingDraft_response(_data, action);
if (res)
{
_resolve();