Web app improvements

This commit is contained in:
Ilya Laktyushin 2023-09-01 15:24:59 +04:00
parent ea52d6e369
commit f850481b2f
2 changed files with 9 additions and 3 deletions

View File

@ -9900,4 +9900,4 @@ Sorry for the inconvenience.";
"WebApp.SharePhoneTitle" = "Share Phone Number?"; "WebApp.SharePhoneTitle" = "Share Phone Number?";
"WebApp.SharePhoneConfirmation" = "**%@** will know your phone number. This can be useful for integration with other services."; "WebApp.SharePhoneConfirmation" = "**%@** will know your phone number. This can be useful for integration with other services.";
"WebApp.SharePhoneConfirmationUnblock" = "**%@** will know your phone number. This can be useful for integration with other services.\n\nThe bot will also be unblocked."; "WebApp.SharePhoneConfirmationUnblock" = "**%@** will know your phone number. This can be useful for integration with other services.\n\nThis will also unblock the bot.";

View File

@ -1104,7 +1104,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
if result { if result {
sendEvent(true) sendEvent(true)
} else { } else {
controller.present(textAlertController(context: self.context, updatedPresentationData: controller.updatedPresentationData, title: self.presentationData.strings.WebApp_AllowWriteTitle, text: self.presentationData.strings.WebApp_AllowWriteConfirmation(controller.botName).string, actions: [TextAlertAction(type: .genericAction, title: self.presentationData.strings.Common_Cancel, action: { let alertController = textAlertController(context: self.context, updatedPresentationData: controller.updatedPresentationData, title: self.presentationData.strings.WebApp_AllowWriteTitle, text: self.presentationData.strings.WebApp_AllowWriteConfirmation(controller.botName).string, actions: [TextAlertAction(type: .genericAction, title: self.presentationData.strings.Common_Cancel, action: {
sendEvent(false) sendEvent(false)
}), TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: { [weak self] in }), TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: { [weak self] in
guard let self else { guard let self else {
@ -1115,7 +1115,13 @@ public final class WebAppController: ViewController, AttachmentContainable {
|> deliverOnMainQueue).start(completed: { |> deliverOnMainQueue).start(completed: {
sendEvent(true) sendEvent(true)
}) })
})], parseMarkdown: true), in: .window(.root)) })], parseMarkdown: true)
alertController.dismissed = { byOutsideTap in
if byOutsideTap {
sendEvent(false)
}
}
controller.present(alertController, in: .window(.root))
} }
}) })
} }