Message List: Fix redundant unread divider in new chats

This commit is contained in:
Alexander Zinchuk 2021-11-27 17:41:45 +01:00
parent b8cab81a73
commit d7e6ebfe06

View File

@ -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