diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp index 4bc2f6a01..3796889c6 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp @@ -1602,7 +1602,7 @@ void VoiceRecordBar::installListenStateFilter() { _listen->playPause(); return Result::Cancel; } - if (isEnter) { + if (isEnter && !_warningShown) { requestToSendWithOptions({}); return Result::Cancel; } @@ -1633,6 +1633,7 @@ void VoiceRecordBar::showDiscardBox( hideAnimated(); } close(); + _warningShown = false; if (callback) { callback(); } @@ -1644,6 +1645,7 @@ void VoiceRecordBar::showDiscardBox( tr::lng_record_lock_discard(tr::now), st::attentionBoxButton, std::move(sure))); + _warningShown = true; } } // namespace HistoryView::Controls diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.h b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.h index ff8e8cdbc..941f39af2 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.h +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.h @@ -143,6 +143,8 @@ private: Fn _startRecordingFilter; + bool _warningShown = false; + rpl::variable _recording = false; rpl::variable _inField = false; rpl::variable _lockShowing = false;