fix: unseen indicator is not shown in thread view when 'listGrouped' settings is false + show unseen message count when the message list is threaded

This commit is contained in:
Sergey Mosin 2023-08-11 21:08:05 -04:00
parent 1b7e144a6e
commit 8ab3055223
3 changed files with 23 additions and 8 deletions

View file

@ -344,13 +344,23 @@ MessagelistUserStore.setAction = (sFolderFullName, iSetAction, messages) => {
length;
if (iSetAction == MessageSetAction.SetSeen) {
messages.forEach(oMessage =>
oMessage.isUnseen() && rootUids.push(oMessage.uid) && oMessage.flags.push('\\seen')
);
messages.forEach(oMessage => {
if (oMessage.isUnseen() && rootUids.push(oMessage.uid)) {
oMessage.flags.push('\\seen');
if (oMessage.threads().length > 0 && oMessage.threadUnseen().includes(oMessage.uid)) {
oMessage.threadUnseen.remove(oMessage.uid);
}
}
});
} else if (iSetAction == MessageSetAction.UnsetSeen) {
messages.forEach(oMessage =>
!oMessage.isUnseen() && rootUids.push(oMessage.uid) && oMessage.flags.remove('\\seen')
);
messages.forEach(oMessage => {
if (!oMessage.isUnseen() && rootUids.push(oMessage.uid)) {
oMessage.flags.remove('\\seen');
if (oMessage.threads().length > 0 && !oMessage.threadUnseen().includes(oMessage.uid)) {
oMessage.threadUnseen.push(oMessage.uid);
}
}
});
} else if (iSetAction == MessageSetAction.SetFlag) {
messages.forEach(oMessage =>
!oMessage.isFlagged() && rootUids.push(oMessage.uid) && oMessage.flags.push('\\flagged')