diff --git a/src/global/actions/api/chats.ts b/src/global/actions/api/chats.ts index f0f74bfbe..3d6c30e41 100644 --- a/src/global/actions/api/chats.ts +++ b/src/global/actions/api/chats.ts @@ -769,6 +769,13 @@ addActionHandler('togglePreHistoryHidden', async (global, actions, payload) => { actions.openChat({ id: chat.id }); } + setGlobal(updateChat(global, chat.id, { + fullInfo: { + ...chat.fullInfo, + isPreHistoryHidden: isEnabled, + }, + })); + void callApi('togglePreHistoryHidden', { chat, isEnabled }); }); @@ -1043,6 +1050,13 @@ addActionHandler('linkDiscussionGroup', async (global, actions, payload) => { } if (fullInfo!.isPreHistoryHidden) { + setGlobal(updateChat(global, chat.id, { + fullInfo: { + ...chat.fullInfo, + isPreHistoryHidden: false, + }, + })); + await callApi('togglePreHistoryHidden', { chat, isEnabled: false }); }