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; return;
} }
const auto shown = _recordingLifetime.make_state<bool>(false); _lockShowing = true;
startRedCircleAnimation();
_recording = true; _recording = true;
_controller->widget()->setInnerFocus(); _controller->widget()->setInnerFocus();
instance()->start(); instance()->start();
instance()->updated( instance()->updated(
) | rpl::start_with_next_error([=](const Update &update) { ) | 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); recordUpdated(update.level, update.samples);
}, [=] { }, [=] {
stop(false); stop(false);