From dd494208519edd13d531f9943e182c57e767229c Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 27 Dec 2022 02:45:35 +0100 Subject: [PATCH] Channel: Correct handling of changes "Chat history for new members" parameter (#2211) --- src/global/actions/api/chats.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 }); }