File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Coder-Desktop/Coder-Desktop/Views/VPN Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ struct MenuItemView: View {
7272
7373 @State private var apps : [ WorkspaceApp ] = [ ]
7474
75+ @State private var loadingApps : Bool = true
76+
7577 var hasApps : Bool { !apps. isEmpty }
7678
7779 private var itemName : AttributedString {
@@ -129,9 +131,13 @@ struct MenuItemView: View {
129131 MenuItemIcons ( item: item, wsURL: wsURL)
130132 }
131133 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 ) :
133139 MenuItemCollapsibleView ( apps: apps)
134- } else {
140+ case ( false , false ) :
135141 HStack {
136142 Text ( item. status == . off ? " Workspace is offline. " : " No apps available. " )
137143 . font ( . body)
@@ -146,6 +152,7 @@ struct MenuItemView: View {
146152 }
147153
148154 func loadApps( ) async {
155+ defer { loadingApps = false }
149156 // If this menu item is an agent, and the user is logged in
150157 if case let . agent( agent) = item,
151158 let client = state. client,
You can’t perform that action at this time.
0 commit comments