From 653d7aadb161668f054a6f3fdc55c581156209be Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 18 Aug 2023 18:14:01 +0200 Subject: [PATCH] Don't close EditCaptionBox with changed media by click. --- Telegram/SourceFiles/boxes/edit_caption_box.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index c9779b1f1..90a989ce7 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -517,7 +517,8 @@ void EditCaptionBox::setInitialText() { _field->setTextCursor(cursor); _checkChangedTimer.setCallback([=] { - if (_field->getTextWithAppliedMarkdown() == _initialText) { + if (_field->getTextWithAppliedMarkdown() == _initialText + && _preparedList.files.empty()) { setCloseByOutsideClick(true); } }); @@ -738,6 +739,7 @@ bool EditCaptionBox::setPreparedList(Ui::PreparedList &&list) { const auto wasSpoiler = hasSpoiler(); _preparedList = std::move(list); _preparedList.files.front().spoiler = wasSpoiler; + setCloseByOutsideClick(false); rebuildPreview(); return true; }