mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
Revert "Message List: Another attempt to fix marking all messages read"
This reverts commit f2f7cc912f74f1312bb7c79866fea7dbf3f671e1.
This commit is contained in:
parent
aeea0f7bb5
commit
ef58550d6e
@ -35,7 +35,6 @@ import {
|
|||||||
selectCurrentMessageList,
|
selectCurrentMessageList,
|
||||||
selectViewportIds,
|
selectViewportIds,
|
||||||
selectFirstUnreadId,
|
selectFirstUnreadId,
|
||||||
selectRealLastReadId,
|
|
||||||
selectChat,
|
selectChat,
|
||||||
} from '../../selectors';
|
} from '../../selectors';
|
||||||
import { getMessageContent, isChatPrivate, isMessageLocal } from '../../helpers';
|
import { getMessageContent, isChatPrivate, isMessageLocal } from '../../helpers';
|
||||||
@ -437,13 +436,12 @@ function updateListedAndViewportIds(global: GlobalState, message: ApiMessage) {
|
|||||||
global = updateListedIds(global, chatId, MAIN_THREAD_ID, [id]);
|
global = updateListedIds(global, chatId, MAIN_THREAD_ID, [id]);
|
||||||
|
|
||||||
if (selectIsViewportNewest(global, chatId, MAIN_THREAD_ID)) {
|
if (selectIsViewportNewest(global, chatId, MAIN_THREAD_ID)) {
|
||||||
// Always keep the first unread message in the viewport list
|
// Always keep the first uread message in the viewport list
|
||||||
const lastReadId = selectRealLastReadId(global, chatId, MAIN_THREAD_ID);
|
|
||||||
const firstUnreadId = selectFirstUnreadId(global, chatId, MAIN_THREAD_ID);
|
const firstUnreadId = selectFirstUnreadId(global, chatId, MAIN_THREAD_ID);
|
||||||
const newGlobal = addViewportId(global, chatId, MAIN_THREAD_ID, id);
|
const newGlobal = addViewportId(global, chatId, MAIN_THREAD_ID, id);
|
||||||
const newViewportIds = selectViewportIds(newGlobal, chatId, MAIN_THREAD_ID);
|
const newViewportIds = selectViewportIds(newGlobal, chatId, MAIN_THREAD_ID);
|
||||||
|
|
||||||
if (!lastReadId || (firstUnreadId && newViewportIds!.includes(firstUnreadId))) {
|
if (!firstUnreadId || newViewportIds!.includes(firstUnreadId)) {
|
||||||
global = newGlobal;
|
global = newGlobal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user