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; } }