mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
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:
parent
1b7e144a6e
commit
8ab3055223
3 changed files with 23 additions and 8 deletions
|
|
@ -128,6 +128,11 @@ export class MessageModel extends AbstractModel {
|
||||||
threadsLen: () => rl.app.messageList.threadUid() ? 0 : this.threads().length,
|
threadsLen: () => rl.app.messageList.threadUid() ? 0 : this.threads().length,
|
||||||
threadUnseenLen: () => rl.app.messageList.threadUid() ? 0 : this.threadUnseen().length,
|
threadUnseenLen: () => rl.app.messageList.threadUid() ? 0 : this.threadUnseen().length,
|
||||||
|
|
||||||
|
threadsLenText: () => {
|
||||||
|
const unseenLen = this.threadUnseenLen();
|
||||||
|
return this.threadsLen() + (unseenLen > 0 ? '/' + unseenLen : '');
|
||||||
|
},
|
||||||
|
|
||||||
isUnseen: () => !this.flags().includes('\\seen'),
|
isUnseen: () => !this.flags().includes('\\seen'),
|
||||||
isFlagged: () => this.flags().includes('\\flagged'),
|
isFlagged: () => this.flags().includes('\\flagged'),
|
||||||
// isJunk: () => this.flags().includes('$junk') && !this.flags().includes('$nonjunk'),
|
// isJunk: () => this.flags().includes('$junk') && !this.flags().includes('$nonjunk'),
|
||||||
|
|
|
||||||
|
|
@ -344,13 +344,23 @@ MessagelistUserStore.setAction = (sFolderFullName, iSetAction, messages) => {
|
||||||
length;
|
length;
|
||||||
|
|
||||||
if (iSetAction == MessageSetAction.SetSeen) {
|
if (iSetAction == MessageSetAction.SetSeen) {
|
||||||
messages.forEach(oMessage =>
|
messages.forEach(oMessage => {
|
||||||
oMessage.isUnseen() && rootUids.push(oMessage.uid) && oMessage.flags.push('\\seen')
|
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) {
|
} else if (iSetAction == MessageSetAction.UnsetSeen) {
|
||||||
messages.forEach(oMessage =>
|
messages.forEach(oMessage => {
|
||||||
!oMessage.isUnseen() && rootUids.push(oMessage.uid) && oMessage.flags.remove('\\seen')
|
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) {
|
} else if (iSetAction == MessageSetAction.SetFlag) {
|
||||||
messages.forEach(oMessage =>
|
messages.forEach(oMessage =>
|
||||||
!oMessage.isFlagged() && rootUids.push(oMessage.uid) && oMessage.flags.push('\\flagged')
|
!oMessage.isFlagged() && rootUids.push(oMessage.uid) && oMessage.flags.push('\\flagged')
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@
|
||||||
<div class="flagParent fontastic"></div>
|
<div class="flagParent fontastic"></div>
|
||||||
<div class="senderParent actionHandle" data-bind="attr: {'title': senderClearEmailsString}, text: senderEmailsString"></div>
|
<div class="senderParent actionHandle" data-bind="attr: {'title': senderClearEmailsString}, text: senderEmailsString"></div>
|
||||||
<div class="subjectParent actionHandle" data-bind="text: subject"></div>
|
<div class="subjectParent actionHandle" data-bind="text: subject"></div>
|
||||||
<div class="threads-len" data-bind="visible: 1 < threadsLen(), text: threadsLen, attr: {'data-unseen': threadUnseenLen() || null}"></div>
|
<div class="threads-len" data-bind="visible: 1 < threadsLen(), text: threadsLenText(), attr: {'data-unseen': threadUnseenLen() || null}"></div>
|
||||||
<div class="attachmentParent actionHandle">
|
<div class="attachmentParent actionHandle">
|
||||||
<i data-bind="css: attachmentIconClass"></i>
|
<i data-bind="css: attachmentIconClass"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -159,7 +159,7 @@
|
||||||
<div class="flagParent fontastic"></div>
|
<div class="flagParent fontastic"></div>
|
||||||
<div class="senderParent actionHandle" data-bind="attr: {'title': senderClearEmailsString}, text: senderEmailsString"></div>
|
<div class="senderParent actionHandle" data-bind="attr: {'title': senderClearEmailsString}, text: senderEmailsString"></div>
|
||||||
<div class="subjectParent actionHandle" data-bind="text: subject"></div>
|
<div class="subjectParent actionHandle" data-bind="text: subject"></div>
|
||||||
<div class="threads-len" data-bind="visible: 1 < threadsLen(), text: threadsLen"></div>
|
<div class="threads-len" data-bind="visible: 1 < threadsLen(), text: threadsLenText(), attr: {'data-unseen': threadUnseenLen() || null}"></div>
|
||||||
<div class="attachmentParent actionHandle">
|
<div class="attachmentParent actionHandle">
|
||||||
<i data-bind="css: attachmentIconClass"></i>
|
<i data-bind="css: attachmentIconClass"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue