File tree 1 file changed +9
-2
lines changed
Coder-Desktop/Coder-Desktop/Views/VPN
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ struct MenuItemView: View {
72
72
73
73
@State private var apps : [ WorkspaceApp ] = [ ]
74
74
75
+ @State private var loadingApps : Bool = true
76
+
75
77
var hasApps : Bool { !apps. isEmpty }
76
78
77
79
private var itemName : AttributedString {
@@ -129,9 +131,13 @@ struct MenuItemView: View {
129
131
MenuItemIcons ( item: item, wsURL: wsURL)
130
132
}
131
133
if isExpanded {
132
- if hasApps {
134
+ switch ( loadingApps, hasApps) {
135
+ case ( true , _) :
136
+ CircularProgressView ( value: nil , strokeWidth: 3 , diameter: 15 )
137
+ . padding ( . top, 5 )
138
+ case ( false , true ) :
133
139
MenuItemCollapsibleView ( apps: apps)
134
- } else {
140
+ case ( false , false ) :
135
141
HStack {
136
142
Text ( item. status == . off ? " Workspace is offline. " : " No apps available. " )
137
143
. font ( . body)
@@ -146,6 +152,7 @@ struct MenuItemView: View {
146
152
}
147
153
148
154
func loadApps( ) async {
155
+ defer { loadingApps = false }
149
156
// If this menu item is an agent, and the user is logged in
150
157
if case let . agent( agent) = item,
151
158
let client = state. client,
You can’t perform that action at this time.
0 commit comments