diff --git a/Mail/Components/ThreadCell/ThreadCell.swift b/Mail/Components/ThreadCell/ThreadCell.swift index c142fd6926..e8a7d8bd78 100644 --- a/Mail/Components/ThreadCell/ThreadCell.swift +++ b/Mail/Components/ThreadCell/ThreadCell.swift @@ -49,7 +49,11 @@ struct ThreadCellDataHolder { let isInWrittenByMeFolder: Bool init(thread: Thread) { - let lastMessageNotFromSent = thread.messages.last { $0.folder?.role != .sent } ?? thread.messages.last + let lastMessageNotFromSent = thread.messages.filter(NSPredicate( + format: "SUBQUERY(folders, $folder, $folder.role != %@).@count > 0", + FolderRole.sent.rawValue + )).last ?? thread.messages.last + date = thread.date.formatted(.thread(.list)) subject = thread.formattedSubject