From 9e9500d0c085ed0c86e32a0f97fb660302b337e2 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 10 Mar 2021 10:31:24 -0700 Subject: [PATCH] Mail: Attempt to stop mail from loading but not displaying the next mail after moving a mail to another folder This is a timing issue. --- mail/js/app.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 36962e6547..2c0dc266ce 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -3588,14 +3588,16 @@ app.classes.mail = AppJS.extend( var self = this; var nm = this.et2.getWidgetById(this.nm_index); + // Nextmatch automatically selects the next row and calls preview. + // Stop it for now, we'll put it back when the copy is done + let on_select = nm.options.onselect; + nm.options.onselect = null; // thev 4th param indicates if it is a normal move messages action. if not the action is a move2.... (archiveFolder) action egw.json('mail.mail_ui.ajax_copyMessages',[target, messages, 'move', (_action.id.substr(0,4)=='move'&&_action.id.substr(4,1)=='2'?'2':'_') ], function(){ self.unlock_tree(); - // Nextmatch automatically selects the next row and calls preview. - // Unselect it and thanks to the timeout selectionMgr uses, preview - // will close when the selection callback fires instead of load the - // next message - nm.controller._selectionMgr.resetSelection(); + + // Restore onselect handler + nm.options.onselect = on_select; // Server response may contain refresh, but it's always delete // Refresh list if current view is the target (happens when pasting)