Fix voice record button infinite animation
Enabling animations triggers an animation of the voice record button that keeps firing uselessly at ~120 calls per second until the button is manually toggled. The animation callback cannot stop itself since it expects the button to be visible. This commit fixes the issue by preventing spawning the animation if the widget is hidden.
This commit is contained in:
parent
2eda5bb2d8
commit
336405b3c7
|
@ -87,7 +87,7 @@ void VoiceRecordButton::init() {
|
|||
_blobs->setLevel(0.);
|
||||
}
|
||||
_blobsHideLastTime = hide ? crl::now() : 0;
|
||||
if (!hide && !_animation.animating()) {
|
||||
if (!hide && !_animation.animating() && isVisible()) {
|
||||
_animation.start();
|
||||
}
|
||||
}, lifetime());
|
||||
|
|
Loading…
Reference in New Issue