mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Stickers Import Improvements
This commit is contained in:
@@ -86,11 +86,14 @@ open class AlertController: ViewController, StandalonePresentableController {
|
||||
private let contentNode: AlertContentNode
|
||||
private let allowInputInset: Bool
|
||||
|
||||
private weak var existingAlertController: AlertController?
|
||||
|
||||
public var dismissed: (() -> Void)?
|
||||
|
||||
public init(theme: AlertControllerTheme, contentNode: AlertContentNode, allowInputInset: Bool = true) {
|
||||
public init(theme: AlertControllerTheme, contentNode: AlertContentNode, existingAlertController: AlertController? = nil, allowInputInset: Bool = true) {
|
||||
self.theme = theme
|
||||
self.contentNode = contentNode
|
||||
self.existingAlertController = existingAlertController
|
||||
self.allowInputInset = allowInputInset
|
||||
|
||||
super.init(navigationBarPresentationData: nil)
|
||||
@@ -108,6 +111,8 @@ open class AlertController: ViewController, StandalonePresentableController {
|
||||
self.displayNode = AlertControllerNode(contentNode: self.contentNode, theme: self.theme, allowInputInset: self.allowInputInset)
|
||||
self.displayNodeDidLoad()
|
||||
|
||||
self.controllerNode.existingAlertControllerNode = self.existingAlertController?.controllerNode
|
||||
|
||||
self.controllerNode.dismiss = { [weak self] in
|
||||
if let strongSelf = self, strongSelf.contentNode.dismissOnOutsideTap {
|
||||
strongSelf.controllerNode.animateOut {
|
||||
@@ -120,6 +125,9 @@ open class AlertController: ViewController, StandalonePresentableController {
|
||||
override open func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
self.existingAlertController?.dismiss(completion: nil)
|
||||
self.existingAlertController = nil
|
||||
|
||||
self.controllerNode.animateIn()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user