From 5d3ceb9e643e7f56066d29609233156253b052b3 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 19 Nov 2021 03:22:27 +0300 Subject: [PATCH] Comments: Fix skipping to last (#1551) --- src/modules/selectors/messages.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/selectors/messages.ts b/src/modules/selectors/messages.ts index e5725862..9271eac2 100644 --- a/src/modules/selectors/messages.ts +++ b/src/modules/selectors/messages.ts @@ -571,7 +571,8 @@ export function selectFirstUnreadId(global: GlobalState, chatId: string, threadI } } else { const threadInfo = selectThreadInfo(global, chatId, threadId); - if (!threadInfo || threadInfo.lastMessageId === threadInfo.lastReadInboxMessageId) { + if (!threadInfo + || (threadInfo.lastMessageId !== undefined && threadInfo.lastMessageId === threadInfo.lastReadInboxMessageId)) { return undefined; } }