Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"conversation.channelHistory.fetchChannelHistoryDepthOptions.error" = "An error occurred while fetching channel history depth options.";
"conversation.channelHistory.updateHistoryDepth.error" = "An error occurred while updating channel history depth.";
"conversation.file.preview.open" = "Open preview";
"conversation.draft.attachmentMenu.errorTitle" = "Unable to load file";
"conversation.draft.attachmentMenu.retry" = "Retry";
"conversation.draft.attachmentMenu.remove" = "Remove File";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ private struct AttachmentsCarouselItemView: View {
static let buttonCornerRadius: CGFloat = 24
}

@State private var showErrorAlert = false

let item: AttachmentsCarouselItem
let onTap: () -> Void
let onRemove: () -> Void
Expand All @@ -83,7 +85,15 @@ private struct AttachmentsCarouselItemView: View {
.padding(.trailing, Constants.trailingPadding)

cornerButton
}
}.alert(
L10n.Localizable.Conversation.Draft.AttachmentMenu.errorTitle,
isPresented: $showErrorAlert,
actions: {
Button(L10n.Localizable.Conversation.Draft.AttachmentMenu.remove, action: { onRemove() })
Button(L10n.Localizable.Conversation.Draft.AttachmentMenu.retry, action: { onRetry() })

}
)
}

@ViewBuilder var content: some View {
Expand Down Expand Up @@ -119,9 +129,8 @@ private struct AttachmentsCarouselItemView: View {
Spacer()

if item.state.isFailed {
Menu {
Button(L10n.Localizable.Conversation.Draft.AttachmentMenu.retry, action: onRetry)
Button(L10n.Localizable.Conversation.Draft.AttachmentMenu.remove, action: onRemove)
Button {
showErrorAlert = true
} label: {
Image(systemName: "ellipsis.circle.fill")
.resizable()
Expand Down
Loading