diff --git a/Telegram/SourceFiles/intro/intro_phone.cpp b/Telegram/SourceFiles/intro/intro_phone.cpp index 0d9dffd448..665ee26bc4 100644 --- a/Telegram/SourceFiles/intro/intro_phone.cpp +++ b/Telegram/SourceFiles/intro/intro_phone.cpp @@ -83,39 +83,25 @@ PhoneWidget::PhoneWidget( } void PhoneWidget::setupQrLogin() { - rpl::single( - rpl::empty_value() - ) | rpl::then( - account().appConfig().refreshed() - ) | rpl::map([=] { - const auto result = account().appConfig().get( - "qr_login_code", - "[not-set]"); - DEBUG_LOG(("PhoneWidget.qr_login_code: %1").arg(result)); - return result; - }) | rpl::filter([](const QString &value) { - return (value != "disabled"); - }) | rpl::take(1) | rpl::start_with_next([=] { - const auto qrLogin = Ui::CreateChild( - this, - tr::lng_phone_to_qr(tr::now)); - qrLogin->show(); + const auto qrLogin = Ui::CreateChild( + this, + tr::lng_phone_to_qr(tr::now)); + qrLogin->show(); - DEBUG_LOG(("PhoneWidget.qrLogin link created and shown.")); + DEBUG_LOG(("PhoneWidget.qrLogin link created and shown.")); - rpl::combine( - sizeValue(), - qrLogin->widthValue() - ) | rpl::start_with_next([=](QSize size, int qrLoginWidth) { - qrLogin->moveToLeft( - (size.width() - qrLoginWidth) / 2, - contentTop() + st::introQrLoginLinkTop); - }, qrLogin->lifetime()); + rpl::combine( + sizeValue(), + qrLogin->widthValue() + ) | rpl::start_with_next([=](QSize size, int qrLoginWidth) { + qrLogin->moveToLeft( + (size.width() - qrLoginWidth) / 2, + contentTop() + st::introQrLoginLinkTop); + }, qrLogin->lifetime()); - qrLogin->setClickedCallback([=] { - goReplace(Animate::Forward); - }); - }, lifetime()); + qrLogin->setClickedCallback([=] { + goReplace(Animate::Forward); + }); } void PhoneWidget::resizeEvent(QResizeEvent *e) { diff --git a/Telegram/SourceFiles/intro/intro_start.cpp b/Telegram/SourceFiles/intro/intro_start.cpp index 0fe3cb61ba..c3b5c1e542 100644 --- a/Telegram/SourceFiles/intro/intro_start.cpp +++ b/Telegram/SourceFiles/intro/intro_start.cpp @@ -31,15 +31,7 @@ StartWidget::StartWidget( void StartWidget::submit() { account().destroyStaleAuthorizationKeys(); - const auto qrLogin = account().appConfig().get( - "qr_login_code", - "[not-set]"); - DEBUG_LOG(("qr_login_code: %1").arg(qrLogin)); - if (qrLogin == "primary") { - goNext(); - } else { - goNext(); - } + goNext(); } rpl::producer StartWidget::nextButtonText() const { diff --git a/Telegram/SourceFiles/window/window_controller.cpp b/Telegram/SourceFiles/window/window_controller.cpp index bde206d3ef..fff293534f 100644 --- a/Telegram/SourceFiles/window/window_controller.cpp +++ b/Telegram/SourceFiles/window/window_controller.cpp @@ -238,17 +238,9 @@ void Controller::clearPasscodeLock() { } void Controller::setupIntro() { - const auto parent = Core::App().domain().maybeLastOrSomeAuthedAccount(); - if (!parent) { - _widget.setupIntro(Intro::EnterPoint::Start); - return; - } - const auto qrLogin = parent->appConfig().get( - "qr_login_code", - "[not-set]"); - DEBUG_LOG(("qr_login_code in setup: %1").arg(qrLogin)); - const auto qr = (qrLogin == "primary"); - _widget.setupIntro(qr ? Intro::EnterPoint::Qr : Intro::EnterPoint::Phone); + _widget.setupIntro(Core::App().domain().maybeLastOrSomeAuthedAccount() + ? Intro::EnterPoint::Qr + : Intro::EnterPoint::Start); } void Controller::setupMain() {