Skip to content

Commit

Permalink
Merge branch 'fix/INBIOS-76-alert-tweak' into 'release/4.16.2'
Browse files Browse the repository at this point in the history
INBIOS-76 Tweak offline alert

See merge request ProtonMail/protonmail-ios!4264
  • Loading branch information
jacekkra committed Aug 1, 2024
2 parents 7ebed34 + 144fc4c commit 4d4a57e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -300,6 +291,7 @@ class ContainableComposeViewController: ComposeContentViewController, BannerRequ
)
self.stepAlert = alert
}

super.startSendingMessage()
}

Expand Down

0 comments on commit 4d4a57e

Please sign in to comment.