Fix staying _replaceMedia button after media edit.

This commit is contained in:
John Preston 2023-04-23 19:23:41 +04:00
parent 95174a5f36
commit 3a8237f03a
1 changed files with 4 additions and 0 deletions

View File

@ -2131,6 +2131,7 @@ void HistoryWidget::showHistory(
_saveEditMsgRequestId = 0;
_processingReplyItem = _replyEditMsg = nullptr;
_processingReplyId = _editMsgId = _replyToId = 0;
_canReplaceMedia = false;
_photoEditMedia = nullptr;
updateReplaceMediaButton();
_previewData = nullptr;
@ -2466,6 +2467,9 @@ void HistoryWidget::registerDraftSource() {
void HistoryWidget::setEditMsgId(MsgId msgId) {
unregisterDraftSources();
_editMsgId = msgId;
if (!msgId) {
_canReplaceMedia = false;
}
if (_history) {
refreshSendAsToggle();
orderWidgets();