Channel: Correct handling of changes "Chat history for new members" parameter (#2211)

This commit is contained in:
Alexander Zinchuk 2022-12-27 02:45:35 +01:00
parent 4309330b2c
commit dd49420851

View File

@ -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 });
}