Added read availability of passkeys from appConfig.

This commit is contained in:
23rd
2025-12-05 10:39:04 +03:00
committed by John Preston
parent feb1ea6502
commit f506f1b830
8 changed files with 25 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/text/text_utilities.h"
#include "ui/image/image_prepare.h"
#include "ui/painter.h"
#include "main/main_app_config.h"
#include "main/main_account.h"
#include "ui/boxes/confirm_box.h"
#include "core/application.h"
@@ -209,6 +210,8 @@ QrWidget::QrWidget(
api().request(base::take(_requestId)).cancel();
refreshCode();
}, lifetime());
_passkeyPossible = account->appConfig().settingsDisplayPasskeys();
}
QString QrWidget::accessibilityName() {
@@ -333,7 +336,7 @@ void QrWidget::setupControls() {
_skip = Ui::CreateChild<Ui::LinkButton>(
this,
tr::lng_intro_qr_phone(tr::now));
if (Platform::WebAuthn::IsSupported()) {
if (Platform::WebAuthn::IsSupported() && _passkeyPossible) {
_passkey = Ui::CreateChild<Ui::LinkButton>(
this,
tr::lng_intro_qr_passkey(tr::now));

View File

@@ -58,6 +58,7 @@ private:
base::Timer _refreshTimer;
mtpRequestId _requestId = 0;
bool _forceRefresh = false;
bool _passkeyPossible = false;
};