File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ struct ControlsView: View {
89
89
pipelineState = . uncompressing
90
90
case . readyOnDisk:
91
91
pipelineState = . loading
92
+ case . failed( let error) :
93
+ pipelineState = . failed( error)
92
94
default :
93
95
break
94
96
}
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ struct StatusView: View {
12
12
@EnvironmentObject var generation : GenerationContext
13
13
var pipelineState : Binding < PipelineState >
14
14
15
+ @State private var showErrorPopover = false
16
+
15
17
func submit( ) {
16
18
if case . running = generation. state { return }
17
19
Task {
@@ -77,8 +79,31 @@ struct StatusView: View {
77
79
78
80
AnyView ( generationStatusView ( ) )
79
81
}
80
- case . failed:
81
- Text ( " Pipeline loading error " )
82
+ case . failed( let error) :
83
+ HStack {
84
+ Text ( " Pipeline loading error " )
85
+ Spacer ( )
86
+ Button {
87
+ showErrorPopover. toggle ( )
88
+ } label: {
89
+ Image ( systemName: " info.circle " )
90
+ } . buttonStyle ( . plain)
91
+ . popover ( isPresented: $showErrorPopover) {
92
+ VStack {
93
+ Text ( verbatim: " \( error) " )
94
+ . lineLimit ( nil )
95
+ . padding ( . all, 5 )
96
+ Button {
97
+ showErrorPopover. toggle ( )
98
+ } label: {
99
+ Text ( " Dismiss " ) . frame ( maxWidth: 200 )
100
+ }
101
+ . padding ( . bottom)
102
+ }
103
+ . frame ( minWidth: 400 , idealWidth: 400 , maxWidth: 400 )
104
+ . fixedSize ( )
105
+ }
106
+ }
82
107
}
83
108
}
84
109
}
You can’t perform that action at this time.
0 commit comments