Message List: Another (2) attempt to fix marking all messages read
This commit is contained in:
parent
85234ae8d7
commit
526b00eda4
@ -36,6 +36,7 @@ import {
|
||||
selectViewportIds,
|
||||
selectFirstUnreadId,
|
||||
selectRealLastReadId,
|
||||
selectChat,
|
||||
} from '../../selectors';
|
||||
import { getMessageContent, isChatPrivate, isMessageLocal } from '../../helpers';
|
||||
|
||||
@ -427,6 +428,12 @@ function updateWithLocalMedia(
|
||||
function updateListedAndViewportIds(global: GlobalState, message: ApiMessage) {
|
||||
const { id, chatId } = message;
|
||||
|
||||
const chat = selectChat(global, chatId);
|
||||
const isUnreadChatNotLoaded = chat && chat.unreadCount && !selectListedIds(global, chatId, MAIN_THREAD_ID);
|
||||
if (isUnreadChatNotLoaded) {
|
||||
return global;
|
||||
}
|
||||
|
||||
global = updateListedIds(global, chatId, MAIN_THREAD_ID, [id]);
|
||||
|
||||
if (selectIsViewportNewest(global, chatId, MAIN_THREAD_ID)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user