Skip to content

Commit

Permalink
webmail: when moving out all messages in a thread (none remaining in …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
mjl- committed Sep 22, 2023
1 parent be5f804 commit 3353062
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions webmail/webmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions webmail/webmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3353062

Please sign in to comment.