From fd974f38280ed7a2593a5c7e5e957b40e39d3fe1 Mon Sep 17 00:00:00 2001 From: Roma Sosnovsky Date: Sun, 12 Dec 2021 23:06:19 +0200 Subject: [PATCH] #1160 update sent message alert --- .../Compose/ComposeViewController.swift | 19 +++++++++---------- .../ComposeMessageService.swift | 8 ++++---- .../Resources/en.lproj/Localizable.strings | 2 ++ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/FlowCrypt/Controllers/Compose/ComposeViewController.swift b/FlowCrypt/Controllers/Compose/ComposeViewController.swift index 0d7b5829d..6034376bb 100644 --- a/FlowCrypt/Controllers/Compose/ComposeViewController.swift +++ b/FlowCrypt/Controllers/Compose/ComposeViewController.swift @@ -190,18 +190,17 @@ final class ComposeViewController: TableNodeViewController { private func updateSpinner(with state: ComposeMessageService.State) { switch state { case .progressChanged(let progress): - showProgressHUD( - progress: progress, - label: state.message ?? "\(progress)" - ) - case .messageSent: - showProgressHUDWithCustomImage( - imageName: "checkmark.circle", - label: "compose_sent".localized - ) + if progress < 1 { + showProgressHUD( + progress: progress, + label: state.message ?? "\(progress)" + ) + } else { + showIndeterminateHUD(with: "sending_title".localized) + } case .startComposing, .validatingMessage: showIndeterminateHUD(with: state.message ?? "") - case .idle: + case .idle, .messageSent: hideSpinner() } } diff --git a/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift b/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift index 7a033b0a7..f7e048849 100644 --- a/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift +++ b/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift @@ -208,13 +208,13 @@ extension ComposeMessageService { case .idle: return nil case .validatingMessage: - return "Validating" + return "validating_title".localized case .startComposing: - return "Encrypting" + return "encrypting_title".localized case .progressChanged: - return "Uploading" + return "compose_uploading".localized case .messageSent: - return "Message sent" + return "compose_message_sent".localized } } diff --git a/FlowCrypt/Resources/en.lproj/Localizable.strings b/FlowCrypt/Resources/en.lproj/Localizable.strings index 503689702..4d4e6f868 100644 --- a/FlowCrypt/Resources/en.lproj/Localizable.strings +++ b/FlowCrypt/Resources/en.lproj/Localizable.strings @@ -4,6 +4,7 @@ "encrypting_title" = "Encrypting..."; "processing_title" = "Processing..."; "sending_title" = "Sending"; +"validating_title" = "Validating"; "unknown_title" = "(unknown)"; "retry_title" = "Retry"; "ok" = "Ok"; @@ -82,6 +83,7 @@ "compose_quote_from" = "On %@ at %@ %@ wrote:"; // Date, time, sender "compose_forward_successful" = "Message forwarded successfully"; "compose_encrypted_sent" = "Encrypted message sent"; +"compose_message_sent" = "Message sent"; "compose_enter_subject" = "Enter subject"; "compose_enter_secure" = "Enter secure message"; "compose_recipient" = "Add Recipient";