Web app improvements

This commit is contained in:
Ilya Laktyushin 2023-09-01 15:01:36 +04:00
parent f432842f75
commit ea52d6e369
2 changed files with 9 additions and 1 deletions

View File

@ -9900,3 +9900,4 @@ Sorry for the inconvenience.";
"WebApp.SharePhoneTitle" = "Share Phone Number?";
"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.";

View File

@ -1150,7 +1150,14 @@ public final class WebAppController: ViewController, AttachmentContainable {
requiresUnblock = true
}
let alertController = textAlertController(context: self.context, updatedPresentationData: controller.updatedPresentationData, title: self.presentationData.strings.WebApp_SharePhoneTitle, text: self.presentationData.strings.WebApp_SharePhoneConfirmation(botName).string, actions: [TextAlertAction(type: .genericAction, title: self.presentationData.strings.Common_Cancel, action: {
let text: String
if requiresUnblock {
text = self.presentationData.strings.WebApp_SharePhoneConfirmationUnblock(botName).string
} else {
text = self.presentationData.strings.WebApp_SharePhoneConfirmation(botName).string
}
let alertController = textAlertController(context: self.context, updatedPresentationData: controller.updatedPresentationData, title: self.presentationData.strings.WebApp_SharePhoneTitle, text: text, actions: [TextAlertAction(type: .genericAction, title: self.presentationData.strings.Common_Cancel, action: {
sendEvent(false)
}), TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: { [weak self] in
guard let self, case let .user(user) = accountPeer, let phone = user.phone, !phone.isEmpty else {