diff --git a/Telegram/SourceFiles/auth_session.cpp b/Telegram/SourceFiles/auth_session.cpp index f3b614b8c..70d5a84bf 100644 --- a/Telegram/SourceFiles/auth_session.cpp +++ b/Telegram/SourceFiles/auth_session.cpp @@ -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() { diff --git a/Telegram/SourceFiles/intro/introwidget.cpp b/Telegram/SourceFiles/intro/introwidget.cpp index a094a3ee9..59b046d51 100644 --- a/Telegram/SourceFiles/intro/introwidget.cpp +++ b/Telegram/SourceFiles/intro/introwidget.cpp @@ -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);