mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-10 21:18:23 +00:00
Alerts
This commit is contained in:
@@ -5,7 +5,9 @@ import AsyncDisplayKit
|
||||
import SwiftSignalKit
|
||||
import TelegramCore
|
||||
import TelegramPresentationData
|
||||
import PresentationDataUtils
|
||||
import ProgressNavigationButtonNode
|
||||
import AccountContext
|
||||
|
||||
public final class AuthorizationSequenceCodeEntryController: ViewController {
|
||||
private var controllerNode: AuthorizationSequenceCodeEntryControllerNode {
|
||||
@@ -14,6 +16,7 @@ public final class AuthorizationSequenceCodeEntryController: ViewController {
|
||||
|
||||
private var validLayout: ContainerViewLayout?
|
||||
|
||||
private let sharedContext: SharedAccountContext
|
||||
private let strings: PresentationStrings
|
||||
private let theme: PresentationTheme
|
||||
|
||||
@@ -45,7 +48,8 @@ public final class AuthorizationSequenceCodeEntryController: ViewController {
|
||||
return self.data?.6 ?? false
|
||||
}
|
||||
|
||||
public init(presentationData: PresentationData, back: @escaping () -> Void) {
|
||||
public init(sharedContext: SharedAccountContext, presentationData: PresentationData, back: @escaping () -> Void) {
|
||||
self.sharedContext = sharedContext
|
||||
self.strings = presentationData.strings
|
||||
self.theme = presentationData.theme
|
||||
|
||||
@@ -61,11 +65,14 @@ public final class AuthorizationSequenceCodeEntryController: ViewController {
|
||||
return false
|
||||
}
|
||||
self.navigationBar?.backPressed = { [weak self] in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
let text: String
|
||||
let proceed: String
|
||||
let stop: String
|
||||
|
||||
if let (_, _, type, _, _, _, _) = self?.data, case .email = type {
|
||||
if let (_, _, type, _, _, _, _) = self.data, case .email = type {
|
||||
text = presentationData.strings.Login_CancelEmailVerification
|
||||
proceed = presentationData.strings.Login_CancelEmailVerificationContinue
|
||||
stop = presentationData.strings.Login_CancelEmailVerificationStop
|
||||
@@ -75,7 +82,7 @@ public final class AuthorizationSequenceCodeEntryController: ViewController {
|
||||
stop = presentationData.strings.Login_CancelPhoneVerificationStop
|
||||
}
|
||||
|
||||
self?.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: text, actions: [TextAlertAction(type: .genericAction, title: proceed, action: {
|
||||
self.present(textAlertController(sharedContext: self.sharedContext, title: nil, text: text, actions: [TextAlertAction(type: .genericAction, title: proceed, action: {
|
||||
}), TextAlertAction(type: .defaultAction, title: stop, action: {
|
||||
back()
|
||||
})]), in: .window(.root))
|
||||
|
||||
Reference in New Issue
Block a user