From dac0a6ec20ccb9aaf98fcc10e45309b4ab08e334 Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Wed, 5 Feb 2025 23:03:00 +0300 Subject: [PATCH] fix: allow go back if there's authed account --- Telegram/SourceFiles/intro/intro_qr.cpp | 8 ++++++++ Telegram/SourceFiles/intro/intro_qr.h | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/intro/intro_qr.cpp b/Telegram/SourceFiles/intro/intro_qr.cpp index a76f7539d..7bb7879a4 100644 --- a/Telegram/SourceFiles/intro/intro_qr.cpp +++ b/Telegram/SourceFiles/intro/intro_qr.cpp @@ -29,6 +29,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "qr/qr_generate.h" #include "styles/style_intro.h" +// AyuGram includes +#include "main/main_domain.h" + + namespace Intro { namespace details { namespace { @@ -234,6 +238,10 @@ rpl::producer QrWidget::nextButtonText() const { return rpl::single(QString()); } +bool QrWidget::hasBack() const { + return Core::App().domain().maybeLastOrSomeAuthedAccount(); +} + void QrWidget::setupControls() { const auto code = PrepareQrWidget(this, _qrCodes.events()); rpl::combine( diff --git a/Telegram/SourceFiles/intro/intro_qr.h b/Telegram/SourceFiles/intro/intro_qr.h index 621b85539..45419f468 100644 --- a/Telegram/SourceFiles/intro/intro_qr.h +++ b/Telegram/SourceFiles/intro/intro_qr.h @@ -27,9 +27,7 @@ public: void submit() override; rpl::producer nextButtonText() const override; - bool hasBack() const override { - return false; - } + bool hasBack() const override; private: int errorTop() const override;