mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +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: () => {
|
||||
let uid = MessagelistUserStore.threadUid(),
|
||||
sort = FolderUserStore.sortMode() || 'DATE';
|
||||
return SettingsUserStore.listGrouped() && (sort.includes('DATE') || sort.includes('FROM')) && !uid;
|
||||
return SettingsUserStore.listGrouped() && sort.includes('DATE') && !uid;
|
||||
},
|
||||
|
||||
groupedList: () => {
|
||||
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()),
|
||||
rtf = Intl.RelativeTimeFormat
|
||||
? new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" }) : 0;
|
||||
|
|
@ -183,19 +196,6 @@ export class MailMessageList extends AbstractViewRight {
|
|||
}
|
||||
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;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue