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.
This commit is contained in:
Mechiel Lukkien 2023-09-22 14:25:25 +02:00
parent be5f804d5b
commit 3353062dbe
No known key found for this signature in database
2 changed files with 8 additions and 8 deletions

View file

@ -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;

View file

@ -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