mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-01 13:13:53 +08:00
fix open uid sort
This commit is contained in:
parent
1aeb66dbff
commit
7e18ad65a3
1 changed files with 3 additions and 2 deletions
|
@ -34,12 +34,13 @@ module.exports = server => (path, session, callback) => {
|
|||
.project({
|
||||
uid: true
|
||||
})
|
||||
.sort([['uid', 1]])
|
||||
//.sort([['uid', 1]])
|
||||
.toArray((err, messages) => {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
mailbox.uidList = messages.map(message => message.uid).sort((a, b) => a.uid - b.uid);
|
||||
// sort and ensure unique UIDs
|
||||
mailbox.uidList = Array.from(new Set(messages.map(message => message.uid))).sort((a, b) => a - b);
|
||||
callback(null, mailbox);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue