Don't close EditCaptionBox with changed media by click.

This commit is contained in:
John Preston 2023-08-18 18:14:01 +02:00
parent 95ea61cd41
commit 653d7aadb1
1 changed files with 3 additions and 1 deletions

View File

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