mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix crash in one-on-one calls.
This commit is contained in:
parent
e523687328
commit
9f2903f81d
1 changed files with 8 additions and 3 deletions
|
@ -355,6 +355,11 @@ void TopBar::initControls() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TopBar::initBlobs() {
|
void TopBar::initBlobs() {
|
||||||
|
const auto group = _groupCall.get();
|
||||||
|
if (!group) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto &hideDuration = kBlobLevelDuration1 * 2;
|
const auto &hideDuration = kBlobLevelDuration1 * 2;
|
||||||
const auto hideLastTime = _blobs->lifetime().make_state<crl::time>(0);
|
const auto hideLastTime = _blobs->lifetime().make_state<crl::time>(0);
|
||||||
const auto lastTime = _blobs->lifetime().make_state<crl::time>(0);
|
const auto lastTime = _blobs->lifetime().make_state<crl::time>(0);
|
||||||
|
@ -374,7 +379,7 @@ void TopBar::initBlobs() {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
_groupCall->stateValue(
|
group->stateValue(
|
||||||
) | rpl::start_with_next([=](Calls::GroupCall::State state) {
|
) | rpl::start_with_next([=](Calls::GroupCall::State state) {
|
||||||
if (state == Calls::GroupCall::State::HangingUp) {
|
if (state == Calls::GroupCall::State::HangingUp) {
|
||||||
_blobs->hide();
|
_blobs->hide();
|
||||||
|
@ -384,7 +389,7 @@ void TopBar::initBlobs() {
|
||||||
auto hideBlobs = rpl::combine(
|
auto hideBlobs = rpl::combine(
|
||||||
rpl::single(anim::Disabled()) | rpl::then(anim::Disables()),
|
rpl::single(anim::Disabled()) | rpl::then(anim::Disables()),
|
||||||
Core::App().appDeactivatedValue(),
|
Core::App().appDeactivatedValue(),
|
||||||
_groupCall->stateValue(
|
group->stateValue(
|
||||||
) | rpl::map([](Calls::GroupCall::State state) {
|
) | rpl::map([](Calls::GroupCall::State state) {
|
||||||
using State = Calls::GroupCall::State;
|
using State = Calls::GroupCall::State;
|
||||||
if (state != State::Creating
|
if (state != State::Creating
|
||||||
|
@ -471,7 +476,7 @@ void TopBar::initBlobs() {
|
||||||
});
|
});
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
_groupCall->levelUpdates(
|
group->levelUpdates(
|
||||||
) | rpl::filter([=](const LevelUpdate &update) {
|
) | rpl::filter([=](const LevelUpdate &update) {
|
||||||
return !*hideLastTime && (update.value > _blobsLastLevel);
|
return !*hideLastTime && (update.value > _blobsLastLevel);
|
||||||
}) | rpl::start_with_next([=](const LevelUpdate &update) {
|
}) | rpl::start_with_next([=](const LevelUpdate &update) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue