Channel: Fix opening comments (#3454)

This commit is contained in:
Alexander Zinchuk 2023-07-05 13:15:25 +02:00
parent 0f04434b65
commit b39b3de86b
3 changed files with 4 additions and 4 deletions

View File

@ -1037,7 +1037,7 @@ async function loadViewportMessages<T extends GlobalState>(
global = addUsers(global, buildCollectionByKey(users, 'id'));
global = addChats(global, buildCollectionByKey(chats, 'id'));
global = updateThreadInfos(global, chatId, repliesThreadInfos);
global = updateThreadInfos(global, repliesThreadInfos);
let listedIds = selectListedIds(global, chatId, threadId);
const outlyingList = offsetId ? selectOutlyingListByMessageId(global, chatId, threadId, offsetId) : undefined;

View File

@ -175,7 +175,7 @@ async function loadAndReplaceMessages<T extends GlobalState>(global: T, actions:
global = updateChats(global, buildCollectionByKey(result.chats, 'id'));
global = updateUsers(global, buildCollectionByKey(result.users, 'id'));
if (result.repliesThreadInfos.length) {
global = updateThreadInfos(global, currentChatId, result.repliesThreadInfos);
global = updateThreadInfos(global, result.repliesThreadInfos);
}
areMessagesLoaded = true;

View File

@ -490,10 +490,10 @@ export function updateThreadInfo<T extends GlobalState>(
}
export function updateThreadInfos<T extends GlobalState>(
global: T, chatId: string, updates: Partial<ApiThreadInfo>[],
global: T, updates: Partial<ApiThreadInfo>[],
): T {
updates.forEach((update) => {
global = updateThreadInfo(global, chatId, update.threadId!, update);
global = updateThreadInfo(global, update.chatId!, update.threadId!, update);
});
return global;