Skip to content

Commit 3bddbe9

Browse files
committed
Order conversation entries by mail receivedDate in ConversationViewer
Close #9937
1 parent b2726c1 commit 3bddbe9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mail-app/mail/view/ConversationViewModel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { ListAutoSelectBehavior, MailListDisplayMode } from "../../../common/mis
2525
import { MailModel } from "../model/MailModel.js"
2626

2727
import { isOfTypeOrSubfolderOf } from "../model/MailChecks.js"
28+
import { compareMails } from "../model/MailUtils"
2829

2930
export type MailViewerViewModelFactory = (options: CreateMailViewerOptions) => MailViewerViewModel
3031

@@ -254,6 +255,9 @@ export class ConversationViewModel {
254255
})
255256
}
256257
}
258+
// conversation is sorted by mail's receivedDate, because we do not recreate the conversationEntry once a draft is sent.
259+
// without sorting, the ordering would be based on when the draft was created, not when it was sent.
260+
newConversation.sort((a, b) => compareMails(b.viewModel.mail, a.viewModel.mail))
257261
return newConversation
258262
}
259263

0 commit comments

Comments
 (0)