Skip to content

Commit

Permalink
Composer: Normalize error UI for media upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Feb 23, 2023
1 parent 3f17afa commit aad3e27
Showing 1 changed file with 2 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,7 @@ struct StatusEditorMediaView: View {
.frame(width: 150, height: 150)
.cornerRadius(8)
if container.error != nil {
VStack {
Text("status.editor.error.upload")
Button {
withAnimation {
viewModel.mediasImages.removeAll(where: { $0.id == container.id })
}
} label: {
VStack {
Text("action.delete")
}
}
.buttonStyle(.bordered)
Button {
Task {
await viewModel.upload(container: container)
}
} label: {
VStack {
Text("action.retry")
}
}
.buttonStyle(.bordered)
}
Text("status.editor.error.upload")
} else if container.mediaAttachment == nil {
ProgressView()
}
Expand Down Expand Up @@ -157,8 +135,7 @@ struct StatusEditorMediaView: View {
private func makeErrorView(error: ServerError) -> some View {
ZStack {
placeholderView
Text("alert.error")
.foregroundColor(.red)
Text("status.editor.error.upload")
}
.alert("alert.error", isPresented: $isErrorDisplayed) {
Button("Ok", action: {})
Expand Down

0 comments on commit aad3e27

Please sign in to comment.