WIP: add toasts

pull/1023/head
Ryan ZHAO 1 year ago
parent 8ce7b27f71
commit 5015301bad

@ -342,16 +342,7 @@ extension ConversationVC:
}
catch {
DispatchQueue.main.async { [weak self] in
let modal: ConfirmationModal = ConfirmationModal(
targetView: self?.view,
info: ConfirmationModal.Info(
title: "sessionMessenger".localized(),
body: .text("An error occurred."),
cancelTitle: "BUTTON_OK".localized(),
cancelStyle: .alert_text
)
)
self?.present(modal, animated: true)
self?.viewModel.showToast(text: "attachmentsErrorLoad".localized())
}
return
}
@ -376,15 +367,7 @@ extension ConversationVC:
let fileName = urlResourceValues.name ?? "attachment".localized()
guard let dataSource = DataSourcePath.dataSource(with: url, shouldDeleteOnDeallocation: false) else {
DispatchQueue.main.async { [weak self] in
let modal: ConfirmationModal = ConfirmationModal(
targetView: self?.view,
info: ConfirmationModal.Info(
title: "ATTACHMENT_PICKER_DOCUMENTS_FAILED_ALERT_TITLE".localized(),
cancelTitle: "BUTTON_OK".localized(),
cancelStyle: .alert_text
)
)
self?.present(modal, animated: true)
self?.viewModel.showToast(text: "attachmentsErrorLoad".localized())
}
return
}

@ -122,7 +122,7 @@ final class InputView: UIView, InputViewButtonDelegate, InputTextViewDelegate, M
let adjustment = (InputViewButton.expandedSize - InputViewButton.size) / 2
let maxWidth = UIScreen.main.bounds.width - 2 * InputViewButton.expandedSize - 2 * Values.smallSpacing - 2 * (Values.mediumSpacing - adjustment)
let result = InputTextView(delegate: self, maxWidth: maxWidth)
result.accessibilityLabel = "Message input box"
result.accessibilityLabel = "contentDescriptionMessageComposition".localized()
result.accessibilityIdentifier = "Message input box"
result.isAccessibilityElement = true

@ -630,6 +630,10 @@
"blockBlockedUser" = "Blocked {name}";
"blockUnblockedUser" = "Unblocked {name}";
"contentDescriptionCamera" = "Camera";
"contentDescriptionMessageComposition" = "Message composition";
"communityLeaveError" = "Failed to leave {communityname}";
"contentDescriptionMediaMessage" = "Media message";
"attachmentsErrorLoad" = "Error attaching file";
// NOT IN THE LIST YET
"APP_STARTUP_EXIT" = "Exit";

Loading…
Cancel
Save