mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-03-28 04:25:28 +00:00
Composer: Normalize error UI for media upload
This commit is contained in:
parent
3f17afa8ac
commit
aad3e27748
1 changed files with 2 additions and 25 deletions
|
@ -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()
|
||||
}
|
||||
|
@ -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: {})
|
||||
|
|
Loading…
Reference in a new issue