Fixed accepting of Enter key in box of voice message discarding.

This commit is contained in:
23rd 2021-02-04 20:55:43 +03:00 committed by John Preston
parent 776c099a25
commit 90f90a4ca3
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -143,6 +143,8 @@ private:
Fn<bool()> _startRecordingFilter;
bool _warningShown = false;
rpl::variable<bool> _recording = false;
rpl::variable<bool> _inField = false;
rpl::variable<bool> _lockShowing = false;