Reapply "Fix passkeys access"

This reverts commit fafafe7ada.
This commit is contained in:
Kylmakalle
2025-12-10 00:46:41 +02:00
parent fafafe7ada
commit ab8a250662
4 changed files with 15 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
sgdeps = [
"//Swiftgram/SGStrings:SGStrings"
]
swift_library(
name = "PasskeysScreen",
module_name = "PasskeysScreen",
@@ -9,7 +13,7 @@ swift_library(
copts = [
"-warnings-as-errors",
],
deps = [
deps = sgdeps + [
"//submodules/Display",
"//submodules/Postbox",
"//submodules/TelegramCore",

View File

@@ -119,7 +119,12 @@ final class PasskeysScreenComponent: Component {
guard let self, let component = self.component else {
return
}
// MARK: Swiftgram
if let tgUrl = URL(string: "tg://settings/privacy") {
UIApplication.shared.open(tgUrl, options: [:], completionHandler: nil)
}
if ({ return true }()) { return }
//
let decodeBase64: (String) -> Data? = { string in
var string = string.replacingOccurrences(of: "-", with: "+")
.replacingOccurrences(of: "_", with: "/")

View File

@@ -1,3 +1,4 @@
import SGStrings
import Foundation
import UIKit
import Display
@@ -295,7 +296,7 @@ final class PasskeysScreenIntroComponent: Component {
),
content: AnyComponentWithIdentity(
id: AnyHashable(0),
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: component.strings.Passkeys_ButtonCreate, font: Font.semibold(17.0), textColor: component.theme.list.itemCheckColors.foregroundColor))))
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: "Common.OpenTelegram".i18n(component.strings.baseLanguageCode), font: Font.semibold(17.0), textColor: component.theme.list.itemCheckColors.foregroundColor))))
),
action: { [weak self] in
guard let self, let component = self.component else {

View File

@@ -1,3 +1,4 @@
import SGStrings
import Foundation
import UIKit
import Display
@@ -283,7 +284,7 @@ final class PasskeysScreenListComponent: Component {
title: AnyComponent(VStack([
AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(
string: component.strings.Passkeys_AddPasskey,
string: "Common.OpenTelegram".i18n(component.strings.baseLanguageCode),
font: Font.regular(17.0),
textColor: component.theme.list.itemAccentColor
)),