mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Add web app removal confirmation
This commit is contained in:
parent
2c7c60ffee
commit
a7e31198b8
@ -7439,6 +7439,9 @@ Sorry for the inconvenience.";
|
||||
"WebApp.MessagePreview" = "Message Preview";
|
||||
"WebApp.Send" = "Send";
|
||||
|
||||
"WebApp.RemoveConfirmationTitle" = "Remove Bot";
|
||||
"WebApp.RemoveConfirmationText" = "Remove **%@** from the attachment menu?";
|
||||
|
||||
"Notifications.SystemTones" = "SYSTEM TONES";
|
||||
"Notifications.TelegramTones" = "TELEGRAM TONES";
|
||||
|
||||
|
@ -538,6 +538,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
private let context: AccountContext
|
||||
private let peerId: PeerId
|
||||
private let botId: PeerId
|
||||
private let botName: String
|
||||
private let url: String?
|
||||
private let queryId: Int64?
|
||||
private let payload: String?
|
||||
@ -559,6 +560,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
self.context = context
|
||||
self.peerId = params.peerId
|
||||
self.botId = params.botId
|
||||
self.botName = params.botName
|
||||
self.url = params.url
|
||||
self.queryId = params.queryId
|
||||
self.payload = params.payload
|
||||
@ -665,10 +667,15 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
}, action: { [weak self] _, f in
|
||||
f(.default)
|
||||
|
||||
if let strongSelf = self {
|
||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||
strongSelf.present(textAlertController(context: context, title: presentationData.strings.WebApp_RemoveConfirmationTitle, text: presentationData.strings.WebApp_RemoveConfirmationText(strongSelf.botName).string, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { [weak self] in
|
||||
if let strongSelf = self {
|
||||
let _ = context.engine.messages.removeBotFromAttachMenu(botId: strongSelf.botId).start()
|
||||
strongSelf.dismiss()
|
||||
}
|
||||
})], parseMarkdown: true), in: .window(.root))
|
||||
}
|
||||
})))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user