From 144fc4cc4fc7007a31b594538b966d1a3cfde58e Mon Sep 17 00:00:00 2001 From: Jacek Krasiukianis Date: Thu, 1 Aug 2024 14:43:10 +0200 Subject: [PATCH] INBIOS-76 Tweak offline alert --- .../APP_share_push_uiTest/Localization.swift | 1 - .../ContainableComposeViewController.swift | 24 +++++++------------ 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/ProtonMail/ProtonMail/Utilities/APP_share_push_uiTest/Localization.swift b/ProtonMail/ProtonMail/Utilities/APP_share_push_uiTest/Localization.swift index 3031c14ea..1ddf46584 100644 --- a/ProtonMail/ProtonMail/Utilities/APP_share_push_uiTest/Localization.swift +++ b/ProtonMail/ProtonMail/Utilities/APP_share_push_uiTest/Localization.swift @@ -1543,7 +1543,6 @@ enum L10n { static let senderChangedMessage = NSLocalizedString("The original sender of this message is no longer valid. Your message will be sent from your default address %@.", comment: "Alert message, shows when current sender address in the composer is invalid anymore, the placeholder is a mail address.") static let blockSenderChangeMessage = NSLocalizedString("Please retry after all attachments are uploaded.", comment: "The alert message that will be shown when user tries to change the sender if there is any attachment being uploaded.") static let sendingWithShareExtensionWhileOfflineIsNotSupported = NSLocalizedString("Sending with the Share extension while offline is not supported", comment: "Alert title") - static let messageSavedAsDraft = NSLocalizedString("Your message has been saved as a draft.", comment: "Alert message") } struct ContactEdit { diff --git a/ProtonMail/ProtonMail/ViewControllers/APP_share/Compose/EmbeddableCompose/ContainableComposeViewController.swift b/ProtonMail/ProtonMail/ViewControllers/APP_share/Compose/EmbeddableCompose/ContainableComposeViewController.swift index d7eb94ff0..95113b0d3 100644 --- a/ProtonMail/ProtonMail/ViewControllers/APP_share/Compose/EmbeddableCompose/ContainableComposeViewController.swift +++ b/ProtonMail/ProtonMail/ViewControllers/APP_share/Compose/EmbeddableCompose/ContainableComposeViewController.swift @@ -272,22 +272,13 @@ class ContainableComposeViewController: ComposeContentViewController, BannerRequ override func startSendingMessage() { guard dependencies.internetConnectionStatusProvider.status.isConnected else { - collectDraftDataAndSaveToDB() - .done { [weak self] _ in - let alert = UIAlertController( - title: L10n.Compose.sendingWithShareExtensionWhileOfflineIsNotSupported, - message: L10n.Compose.messageSavedAsDraft, - preferredStyle: .alert - ) - alert.addAction(.okAction() { [weak self] _ in - self?.dismissAnimation() - }) - self?.stepAlert = alert - } - .catch { error in - PMAssertionFailure(error) - } - + let alert = UIAlertController( + title: L10n.Compose.sendingWithShareExtensionWhileOfflineIsNotSupported, + message: nil, + preferredStyle: .alert + ) + alert.addAction(.okAction()) + stepAlert = alert return } @@ -300,6 +291,7 @@ class ContainableComposeViewController: ComposeContentViewController, BannerRequ ) self.stepAlert = alert } + super.startSendingMessage() }