From d7e6ebfe0693115783afa9fdded24579c05b87b9 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 27 Nov 2021 17:41:45 +0100 Subject: [PATCH] Message List: Fix redundant unread divider in new chats --- src/modules/selectors/messages.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/selectors/messages.ts b/src/modules/selectors/messages.ts index 9271eac2..fa9b5f33 100644 --- a/src/modules/selectors/messages.ts +++ b/src/modules/selectors/messages.ts @@ -596,13 +596,9 @@ export function selectFirstUnreadId(global: GlobalState, chatId: string, threadI : -1; function findAfterLastReadId(listIds: number[]) { - if (!lastReadId) { - return listIds[0]; - } - return listIds.find((id) => { return ( - id > lastReadId + (!lastReadId || id > lastReadId) && byId[id] && (!byId[id].isOutgoing || byId[id].isFromScheduled) && id > lastReadServiceNotificationId