Skip to content

Commit abc053b

Browse files
committed
fixup
1 parent 2f5f408 commit abc053b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Coder Desktop/Coder Desktop/VPNMenuState.swift

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ struct Agent: Identifiable, Equatable, Comparable {
1818
return lhs.wsName.localizedCompare(rhs.wsName) == .orderedAscending
1919
}
2020

21-
// Choose the shortest hostname, and remove trailing dot if present
22-
var primaryHost: String? { fqdns.min(by: { $0.count < $1.count })
23-
.map { $0.hasSuffix(".") ? String($0.dropLast()) : $0 }
24-
}
21+
var primaryHost: String? { fqdns.min(by: { $0.count < $1.count }) }
2522
}
2623

2724
enum AgentStatus: Int, Equatable, Comparable {
@@ -72,7 +69,8 @@ struct VPNMenuState {
7269
name: agent.name,
7370
// If last handshake was not within last five minutes, the agent is unhealthy
7471
status: agent.lastHandshake.date > Date.now.addingTimeInterval(-300) ? .okay : .warn,
75-
fqdns: agent.fqdn,
72+
// Remove trailing dot if present
73+
fqdns: agent.fqdn.map { $0.hasSuffix(".") ? String($0.dropLast()) : $0 },
7674
wsName: wsName,
7775
wsID: wsID
7876
)

0 commit comments

Comments
 (0)