Skip to content

Commit ac93c9c

Browse files
committed
clear menustate on start
1 parent aedbe8e commit ac93c9c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Coder Desktop/Coder Desktop/VPNMenuState.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ struct VPNMenuState {
104104

105105
mutating func upsertWorkspace(_ workspace: Vpn_Workspace) {
106106
guard let wsID = UUID(uuidData: workspace.id) else { return }
107-
workspaces[wsID] = Workspace(id: wsID, name: workspace.name, agents: [])
107+
// Workspace names are unique & case-insensitive, and we want to show offline workspaces
108+
// with a valid hostname (lowercase).
109+
workspaces[wsID] = Workspace(id: wsID, name: workspace.name.lowercased(), agents: [])
108110
// Check if we can associate any invalid agents with this workspace
109111
invalidAgents.filter { agent in
110112
agent.workspaceID == workspace.id

Coder Desktop/Coder Desktop/VPNService.swift

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ final class CoderVPNService: NSObject, VPNService {
9090
return
9191
}
9292

93+
menuState.clear()
9394
await startTunnel()
9495
logger.debug("network extension enabled")
9596
}

0 commit comments

Comments
 (0)