Skip to content

Commit aad3e27

Browse files
committed
Composer: Normalize error UI for media upload
1 parent 3f17afa commit aad3e27

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

Packages/Status/Sources/Status/Editor/Components/StatusEditorMediaView.swift

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,29 +65,7 @@ struct StatusEditorMediaView: View {
6565
.frame(width: 150, height: 150)
6666
.cornerRadius(8)
6767
if container.error != nil {
68-
VStack {
69-
Text("status.editor.error.upload")
70-
Button {
71-
withAnimation {
72-
viewModel.mediasImages.removeAll(where: { $0.id == container.id })
73-
}
74-
} label: {
75-
VStack {
76-
Text("action.delete")
77-
}
78-
}
79-
.buttonStyle(.bordered)
80-
Button {
81-
Task {
82-
await viewModel.upload(container: container)
83-
}
84-
} label: {
85-
VStack {
86-
Text("action.retry")
87-
}
88-
}
89-
.buttonStyle(.bordered)
90-
}
68+
Text("status.editor.error.upload")
9169
} else if container.mediaAttachment == nil {
9270
ProgressView()
9371
}
@@ -157,8 +135,7 @@ struct StatusEditorMediaView: View {
157135
private func makeErrorView(error: ServerError) -> some View {
158136
ZStack {
159137
placeholderView
160-
Text("alert.error")
161-
.foregroundColor(.red)
138+
Text("status.editor.error.upload")
162139
}
163140
.alert("alert.error", isPresented: $isErrorDisplayed) {
164141
Button("Ok", action: {})

0 commit comments

Comments
 (0)