diff --git a/src/global/actions/api/messages.ts b/src/global/actions/api/messages.ts index 7185edbe4..98324bd41 100644 --- a/src/global/actions/api/messages.ts +++ b/src/global/actions/api/messages.ts @@ -1037,7 +1037,7 @@ async function loadViewportMessages( 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; diff --git a/src/global/actions/api/sync.ts b/src/global/actions/api/sync.ts index b7d1c1ddc..cdd632b17 100644 --- a/src/global/actions/api/sync.ts +++ b/src/global/actions/api/sync.ts @@ -175,7 +175,7 @@ async function loadAndReplaceMessages(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; diff --git a/src/global/reducers/messages.ts b/src/global/reducers/messages.ts index d823fc2c8..d3ad58fa7 100644 --- a/src/global/reducers/messages.ts +++ b/src/global/reducers/messages.ts @@ -490,10 +490,10 @@ export function updateThreadInfo( } export function updateThreadInfos( - global: T, chatId: string, updates: Partial[], + global: T, updates: Partial[], ): T { updates.forEach((update) => { - global = updateThreadInfo(global, chatId, update.threadId!, update); + global = updateThreadInfo(global, update.chatId!, update.threadId!, update); }); return global;