Removed delay for voice lock widget appearing.

This commit is contained in:
23rd 2020-11-19 01:33:13 +03:00 committed by John Preston
parent cbaca6382e
commit f75fb33c29

View file

@ -1218,19 +1218,14 @@ void VoiceRecordBar::startRecording() {
return;
}
const auto shown = _recordingLifetime.make_state<bool>(false);
_lockShowing = true;
startRedCircleAnimation();
_recording = true;
_controller->widget()->setInnerFocus();
instance()->start();
instance()->updated(
) | rpl::start_with_next_error([=](const Update &update) {
if (!(*shown) && !_showAnimation.animating()) {
// Show the lock widget after the first successful update.
*shown = true;
_lockShowing = true;
startRedCircleAnimation();
}
recordUpdated(update.level, update.samples);
}, [=] {
stop(false);