Message: Fix edit handling (#2686)

This commit is contained in:
Alexander Zinchuk 2023-02-25 18:50:36 +01:00
parent 9ccc7e3ff9
commit 3d70b46504

View File

@ -188,6 +188,9 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => {
case 'updateMessage': {
const { chatId, id, message } = update;
const currentMessage = selectChatMessage(global, chatId, id);
const chat = selectChat(global, chatId);
global = updateWithLocalMedia(global, chatId, id, message);
const newMessage = selectChatMessage(global, chatId, id)!;
@ -200,9 +203,6 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => {
);
}
const currentMessage = selectChatMessage(global, chatId, id);
const chat = selectChat(global, chatId);
if (currentMessage) {
global = updateChatLastMessage(global, chatId, newMessage);
}