mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Fix webapp alert buttons order
This commit is contained in:
@@ -992,7 +992,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
let title = json["title"] as? String
|
||||
var alertButtons: [TextAlertAction] = []
|
||||
|
||||
for buttonJson in buttons {
|
||||
for buttonJson in buttons.reversed() {
|
||||
if let button = buttonJson as? [String: Any], let id = button["id"] as? String, let type = button["type"] as? String {
|
||||
let buttonAction = {
|
||||
self.sendAlertButtonEvent(id: id)
|
||||
@@ -1032,6 +1032,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
var actionLayout: TextAlertContentActionLayout = .horizontal
|
||||
if alertButtons.count > 2 {
|
||||
actionLayout = .vertical
|
||||
alertButtons = Array(alertButtons.reversed())
|
||||
}
|
||||
let alertController = textAlertController(context: self.context, updatedPresentationData: self.controller?.updatedPresentationData, title: title, text: message, actions: alertButtons, actionLayout: actionLayout)
|
||||
alertController.dismissed = { byOutsideTap in
|
||||
|
||||
Reference in New Issue
Block a user