Allow deleting link preview when editing (#1087)

This commit is contained in:
Alexander Zinchuk 2021-05-13 12:00:19 +03:00
parent ea01d28496
commit 8036c0dc87
2 changed files with 4 additions and 1 deletions

View File

@ -404,11 +404,13 @@ export async function editMessage({
message,
text,
entities,
noWebPage,
}: {
chat: ApiChat;
message: ApiMessage;
text: string;
entities?: ApiMessageEntity[];
noWebPage?: boolean;
}) {
const isScheduled = message.date * 1000 > Date.now();
const messageUpdate: Partial<ApiMessage> = {
@ -441,6 +443,7 @@ export async function editMessage({
peer: buildInputPeer(chat.id, chat.accessHash),
id: message.id,
...(isScheduled && { scheduleDate: message.date }),
...(noWebPage && { noWebpage: noWebPage }),
}), true);
}

View File

@ -258,7 +258,7 @@ addReducer('editMessage', (global, actions, payload) => {
}
void callApi('editMessage', {
chat, message, text, entities,
chat, message, text, entities, noWebPage: selectNoWebPage(global, chatId, threadId),
});
actions.setEditingId({ messageId: undefined });