mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 16:07:03 +03:00
When sorting on FROM also sort on REVERSE DATE
This commit is contained in:
parent
faa17ca3de
commit
7c928ee78e
2 changed files with 17 additions and 17 deletions
|
|
@ -150,12 +150,25 @@ export class MailMessageList extends AbstractViewRight {
|
||||||
listGrouped: () => {
|
listGrouped: () => {
|
||||||
let uid = MessagelistUserStore.threadUid(),
|
let uid = MessagelistUserStore.threadUid(),
|
||||||
sort = FolderUserStore.sortMode() || 'DATE';
|
sort = FolderUserStore.sortMode() || 'DATE';
|
||||||
return SettingsUserStore.listGrouped() && (sort.includes('DATE') || sort.includes('FROM')) && !uid;
|
return SettingsUserStore.listGrouped() && sort.includes('DATE') && !uid;
|
||||||
},
|
},
|
||||||
|
|
||||||
groupedList: () => {
|
groupedList: () => {
|
||||||
let list = [], current, sort = FolderUserStore.sortMode() || 'DATE';
|
let list = [], current, sort = FolderUserStore.sortMode() || 'DATE';
|
||||||
if (sort.includes('DATE')) {
|
if (sort.includes('FROM')) {
|
||||||
|
MessagelistUserStore.forEach(msg => {
|
||||||
|
let email = msg.from[0].email;
|
||||||
|
if (!current || email != current.id) {
|
||||||
|
current = {
|
||||||
|
id: email,
|
||||||
|
label: msg.from[0].toLine(),
|
||||||
|
messages: []
|
||||||
|
};
|
||||||
|
list.push(current);
|
||||||
|
}
|
||||||
|
current.messages.push(msg);
|
||||||
|
});
|
||||||
|
} else if (sort.includes('DATE')) {
|
||||||
let today = Ymd(new Date()),
|
let today = Ymd(new Date()),
|
||||||
rtf = Intl.RelativeTimeFormat
|
rtf = Intl.RelativeTimeFormat
|
||||||
? new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" }) : 0;
|
? new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" }) : 0;
|
||||||
|
|
@ -183,19 +196,6 @@ export class MailMessageList extends AbstractViewRight {
|
||||||
}
|
}
|
||||||
current.messages.push(msg);
|
current.messages.push(msg);
|
||||||
});
|
});
|
||||||
} else if (sort.includes('FROM')) {
|
|
||||||
MessagelistUserStore.forEach(msg => {
|
|
||||||
let email = msg.from[0].email;
|
|
||||||
if (!current || email != current.id) {
|
|
||||||
current = {
|
|
||||||
id: email,
|
|
||||||
label: msg.from[0].toLine(),
|
|
||||||
messages: []
|
|
||||||
};
|
|
||||||
list.push(current);
|
|
||||||
}
|
|
||||||
current.messages.push(msg);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -93,10 +93,10 @@
|
||||||
<li role="presentation" data-sort="REVERSE SUBJECT" data-bind="click: changeSort">
|
<li role="presentation" data-sort="REVERSE SUBJECT" data-bind="click: changeSort">
|
||||||
<a href="#" tabindex="-1" data-icon="𝐒⬆" data-i18n="MESSAGE_LIST/SORT_SUBJECT_DESC"></a>
|
<a href="#" tabindex="-1" data-icon="𝐒⬆" data-i18n="MESSAGE_LIST/SORT_SUBJECT_DESC"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="dividerbar" role="presentation" data-sort="FROM" data-bind="click: changeSort">
|
<li class="dividerbar" role="presentation" data-sort="FROM REVERSE DATE" data-bind="click: changeSort">
|
||||||
<a href="#" tabindex="-1" data-icon="@⬇" data-i18n="MESSAGE_LIST/SORT_FROM_ASC"></a>
|
<a href="#" tabindex="-1" data-icon="@⬇" data-i18n="MESSAGE_LIST/SORT_FROM_ASC"></a>
|
||||||
</li>
|
</li>
|
||||||
<li role="presentation" data-sort="REVERSE FROM" data-bind="click: changeSort">
|
<li role="presentation" data-sort="REVERSE FROM REVERSE DATE" data-bind="click: changeSort">
|
||||||
<a href="#" tabindex="-1" data-icon="@⬆" data-i18n="MESSAGE_LIST/SORT_FROM_DESC"></a>
|
<a href="#" tabindex="-1" data-icon="@⬆" data-i18n="MESSAGE_LIST/SORT_FROM_DESC"></a>
|
||||||
</li>
|
</li>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue