WIP: add toasts

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

@ -342,16 +342,7 @@ extension ConversationVC:
} }
catch { catch {
DispatchQueue.main.async { [weak self] in DispatchQueue.main.async { [weak self] in
let modal: ConfirmationModal = ConfirmationModal( self?.viewModel.showToast(text: "attachmentsErrorLoad".localized())
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)
} }
return return
} }
@ -376,15 +367,7 @@ extension ConversationVC:
let fileName = urlResourceValues.name ?? "attachment".localized() let fileName = urlResourceValues.name ?? "attachment".localized()
guard let dataSource = DataSourcePath.dataSource(with: url, shouldDeleteOnDeallocation: false) else { guard let dataSource = DataSourcePath.dataSource(with: url, shouldDeleteOnDeallocation: false) else {
DispatchQueue.main.async { [weak self] in DispatchQueue.main.async { [weak self] in
let modal: ConfirmationModal = ConfirmationModal( self?.viewModel.showToast(text: "attachmentsErrorLoad".localized())
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)
} }
return return
} }

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

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

Loading…
Cancel
Save