Fix crash in AuthSession::Exists() if there is no Messenger.
Also use toggleAnimated instead of show/hideAnimated in intro.
This commit is contained in:
parent
bf0bf908c2
commit
bc7139d67a
|
@ -93,7 +93,10 @@ AuthSession::AuthSession(UserId userId)
|
|||
}
|
||||
|
||||
bool AuthSession::Exists() {
|
||||
return (Messenger::Instance().authSession() != nullptr);
|
||||
if (auto messenger = Messenger::InstancePointer()) {
|
||||
return (messenger->authSession() != nullptr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
AuthSession &AuthSession::Current() {
|
||||
|
|
|
@ -153,20 +153,12 @@ void Widget::historyMove(Direction direction) {
|
|||
if (direction == Direction::Back || direction == Direction::Replace) {
|
||||
delete base::take(wasStep);
|
||||
}
|
||||
if (getStep()->hasBack()) {
|
||||
_back->showAnimated();
|
||||
} else {
|
||||
_back->hideAnimated();
|
||||
}
|
||||
if (getStep()->hasCover()) {
|
||||
_settings->hideAnimated();
|
||||
if (_update) _update->hideAnimated();
|
||||
if (_changeLanguage) _changeLanguage->showAnimated();
|
||||
} else {
|
||||
_settings->showAnimated();
|
||||
if (_update) _update->showAnimated();
|
||||
if (_changeLanguage) _changeLanguage->hideAnimated();
|
||||
}
|
||||
_back->toggleAnimated(getStep()->hasBack());
|
||||
|
||||
auto stepHasCover = getStep()->hasCover();
|
||||
_settings->toggleAnimated(!stepHasCover);
|
||||
if (_update) _update->toggleAnimated(!stepHasCover);
|
||||
if (_changeLanguage) _changeLanguage->toggleAnimated(stepHasCover);
|
||||
_next->setText(getStep()->nextButtonText());
|
||||
if (_resetAccount) _resetAccount->hideAnimated();
|
||||
getStep()->showAnimated(direction);
|
||||
|
|
Loading…
Reference in New Issue