mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-25 19:08:04 +01:00
Smarter incoming message handling for filter by unread
This commit is contained in:
@@ -165,12 +165,17 @@ export function filterAndSortConversations(
|
||||
conversations: ReadonlyArray<ConversationType>,
|
||||
searchTerm: string,
|
||||
regionCode: string | undefined,
|
||||
filterByUnread: boolean = false
|
||||
filterByUnread: boolean = false,
|
||||
conversationToInject?: ConversationType
|
||||
): Array<ConversationType> {
|
||||
const filteredConversations = filterByUnread
|
||||
let filteredConversations = filterByUnread
|
||||
? filterConversationsByUnread(conversations, true)
|
||||
: conversations;
|
||||
|
||||
if (conversationToInject) {
|
||||
filteredConversations = [...filteredConversations, conversationToInject];
|
||||
}
|
||||
|
||||
if (searchTerm.length) {
|
||||
const now = Date.now();
|
||||
const withoutUnknownAndFiltered = filteredConversations.filter(
|
||||
|
||||
Reference in New Issue
Block a user