Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcefb0c5

Browse files
committed
feat: show when workspace apps are loading
ethan/workspace-apps-loading
1 parent2adace3 commitcefb0c5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenuItem.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ struct MenuItemView: View {
7272

7373
@Stateprivatevarapps:[WorkspaceApp]=[]
7474

75+
@StateprivatevarloadingApps:Bool=true
76+
7577
varhasApps:Bool{ !apps.isEmpty}
7678

7779
privatevaritemName: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 caselet.agent(agent)= item,
151158
let client= state.client,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp