Skip to content

Commit b594a7c

Browse files
committed
fix: handle missing workspace app display_name
1 parent 565665f commit b594a7c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Coder-Desktop/Coder-Desktop/Views/VPN/WorkspaceAppIcon.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ struct WorkspaceApp {
7575
sessionToken: String
7676
) throws(WorkspaceAppError) {
7777
slug = original.slug
78-
displayName = original.display_name
78+
// Same behaviour as the web UI
79+
displayName = original.display_name ?? original.slug
7980

8081
guard original.external else {
8182
throw .isWebApp
@@ -196,7 +197,7 @@ func vscodeDisplayApp(hostname: String, baseIconURL: URL, path: String? = nil) -
196197
}
197198

198199
func vscodeInsidersDisplayApp(hostname: String, baseIconURL: URL, path: String? = nil) -> WorkspaceApp {
199-
let icon = baseIconURL.appendingPathComponent("/icon/code.svg")
200+
let icon = baseIconURL.appendingPathComponent("/icon/code-insiders.svg")
200201
return WorkspaceApp(
201202
slug: "-vscode-insiders",
202203
displayName: "VS Code Insiders Desktop",

Coder-Desktop/CoderSDK/Workspace.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ public struct WorkspaceAgent: Codable, Identifiable, Sendable {
5656

5757
public struct WorkspaceApp: Codable, Identifiable, Sendable {
5858
public let id: UUID
59-
// Not `omitempty`, but `coderd` sends empty string if `command` is set
60-
public var url: URL?
59+
public var url: URL? // `omitempty`
6160
public let external: Bool
6261
public let slug: String
63-
public let display_name: String
62+
public let display_name: String? // `omitempty`
6463
public let command: String? // `omitempty`
6564
public let icon: URL? // `omitempty`
6665
public let subdomain: Bool

0 commit comments

Comments
 (0)