Added hiding of Blob animations at animations disabling.

This commit is contained in:
23rd 2020-12-03 21:10:08 +03:00
parent 79d5a49e7c
commit f4dfd738ec
1 changed files with 10 additions and 5 deletions

View File

@ -516,14 +516,19 @@ MembersController::MembersController(
_coloredCrossLine.invalidate();
}, _lifetime);
Core::App().appDeactivates(
) | rpl::start_with_next([=](bool hide) {
_speakingAnimationHideLastTime = hide ? crl::now() : 0;
rpl::combine(
rpl::single(anim::Disabled()) | rpl::then(anim::Disables()),
rpl::single(false) | rpl::then(Core::App().appDeactivates())
) | rpl::start_with_next([=](bool animDisabled, bool deactivated) {
const auto hide = !(!animDisabled && !deactivated);
if (!(hide && _speakingAnimationHideLastTime)) {
_speakingAnimationHideLastTime = hide ? crl::now() : 0;
}
for (const auto [_, row] : _speakingRowBySsrc) {
if (hide) {
row->updateLevel(0.);
updateRowLevel(row, 0.);
}
updateRowLevel(row, 0.);
if (!hide && !_speakingAnimation.animating()) {
_speakingAnimation.start();
}