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.
This commit is contained in:
nathangray 2021-03-10 10:31:24 -07:00
parent cc6691ffe2
commit 9e9500d0c0

View File

@ -3588,14 +3588,16 @@ app.classes.mail = AppJS.extend(
var self = this; var self = this;
var nm = this.et2.getWidgetById(this.nm_index); 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 // 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(){ 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(); self.unlock_tree();
// Nextmatch automatically selects the next row and calls preview.
// Unselect it and thanks to the timeout selectionMgr uses, preview // Restore onselect handler
// will close when the selection callback fires instead of load the nm.options.onselect = on_select;
// next message
nm.controller._selectionMgr.resetSelection();
// Server response may contain refresh, but it's always delete // Server response may contain refresh, but it's always delete
// Refresh list if current view is the target (happens when pasting) // Refresh list if current view is the target (happens when pasting)