diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index 1ba76c725..010df1024 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -358,8 +358,8 @@ extension ConversationVC: let modal: ConfirmationModal = ConfirmationModal( targetView: self?.view, info: ConfirmationModal.Info( - title: "attachmentsErrorNotSupported".localized(), - body: .text("attachmentsErrorSize".localized()), + title: "attachmentsErrorLoad".localized(), + body: .text("attachmentsErrorNotSupported".localized()), cancelTitle: "okay".localized(), cancelStyle: .alert_text ) @@ -2564,16 +2564,18 @@ extension ConversationVC: // MARK: - Convenience func showErrorAlert(for attachment: SignalAttachment) { - let modal: ConfirmationModal = ConfirmationModal( - targetView: self.view, - info: ConfirmationModal.Info( - title: "attachmentsErrorSending".localized(), - body: .text(attachment.localizedErrorDescription ?? SignalAttachment.missingDataErrorMessage), - cancelTitle: "okay".localized(), - cancelStyle: .alert_text + DispatchQueue.main.async { [weak self] in + let modal: ConfirmationModal = ConfirmationModal( + targetView: self?.view, + info: ConfirmationModal.Info( + title: "attachmentsErrorSending".localized(), + body: .text(attachment.localizedErrorDescription ?? SignalAttachment.missingDataErrorMessage), + cancelTitle: "okay".localized(), + cancelStyle: .alert_text + ) ) - ) - self.present(modal, animated: true) + self?.present(modal, animated: true) + } } } diff --git a/Session/Media Viewing & Editing/SendMediaNavigationController.swift b/Session/Media Viewing & Editing/SendMediaNavigationController.swift index 310e751d2..6ead0d26c 100644 --- a/Session/Media Viewing & Editing/SendMediaNavigationController.swift +++ b/Session/Media Viewing & Editing/SendMediaNavigationController.swift @@ -293,8 +293,8 @@ extension SendMediaNavigationController: PhotoCaptureViewControllerDelegate { if !pushApprovalViewController() { let modal: ConfirmationModal = ConfirmationModal( info: ConfirmationModal.Info( - title: "IMAGE_PICKER_FAILED_TO_PROCESS_ATTACHMENTS".localized(), - cancelTitle: "BUTTON_OK".localized(), + title: "attachmentsErrorMediaSelection".localized(), + cancelTitle: "okay".localized(), cancelStyle: .alert_text ) ) diff --git a/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift b/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift index 7a86840f5..16dcf5216 100644 --- a/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift +++ b/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift @@ -40,14 +40,14 @@ extension String { extension SignalAttachmentError: LocalizedError { public var errorDescription: String? { switch self { - case .fileSizeTooLarge: - return "attachmentsErrorSize".localized() - case .invalidData, .missingData, .invalidFileFormat: - return "attachmentsErrorNotSupported".localized() - case .couldNotConvertToJpeg, .couldNotParseImage, .couldNotConvertToMpeg4, .couldNotResizeImage: - return "attachmentsErrorOpen".localized() - case .couldNotRemoveMetadata: - return "attachmentsImageErrorMetadata".localized() + case .fileSizeTooLarge: + return "attachmentsErrorSize".localized() + case .invalidData, .missingData, .invalidFileFormat: + return "attachmentsErrorNotSupported".localized() + case .couldNotConvertToJpeg, .couldNotParseImage, .couldNotConvertToMpeg4, .couldNotResizeImage: + return "attachmentsErrorOpen".localized() + case .couldNotRemoveMetadata: + return "attachmentsImageErrorMetadata".localized() } } }