From 3353062dbe0111a18d42b186f5b9575f674dc080 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Fri, 22 Sep 2023 14:25:25 +0200 Subject: [PATCH] webmail: when moving out all messages in a thread (none remaining in view), don't cause js error but select next message removing an item from the selected list should be done regardless of focus, i.e. the code snippet shouldn't have been behind the "if (focus...)" condition. --- webmail/webmail.js | 8 ++++---- webmail/webmail.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/webmail/webmail.js b/webmail/webmail.js index 413d2f9..a11500e 100644 --- a/webmail/webmail.js +++ b/webmail/webmail.js @@ -3606,10 +3606,10 @@ const newMsglistView = (msgElem, listMailboxes, setLocationHash, otherMailbox, p else if (i > 0) { focus = mivs[i - 1]; } - const si = selected.indexOf(miv); - if (si >= 0) { - selected.splice(si, 1); - } + } + const si = selected.indexOf(miv); + if (si >= 0) { + selected.splice(si, 1); } // Strict cleanup. miv.parent = null; diff --git a/webmail/webmail.ts b/webmail/webmail.ts index 8759157..30736e4 100644 --- a/webmail/webmail.ts +++ b/webmail/webmail.ts @@ -3394,10 +3394,10 @@ const newMsglistView = (msgElem: HTMLElement, listMailboxes: listMailboxes, setL } else if (i > 0) { focus = mivs[i-1] } - const si = selected.indexOf(miv) - if (si >= 0) { - selected.splice(si, 1) - } + } + const si = selected.indexOf(miv) + if (si >= 0) { + selected.splice(si, 1) } // Strict cleanup. miv.parent = null