diff --git a/Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenuItem.swift b/Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenuItem.swift index 3446429..71e753d 100644 --- a/Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenuItem.swift +++ b/Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenuItem.swift @@ -83,10 +83,12 @@ struct MenuItemView: View { var hasApps: Bool { !apps.isEmpty } - private var itemName: AttributedString { - let name = item.primaryHost(hostnameSuffix: state.hostnameSuffix) + private var plainItemName: String { + item.primaryHost(hostnameSuffix: state.hostnameSuffix) + } - var formattedName = AttributedString(name) + private var itemName: AttributedString { + var formattedName = AttributedString(plainItemName) formattedName.foregroundColor = .primary if let range = formattedName.range(of: ".\(state.hostnameSuffix)", options: .backwards) { @@ -134,6 +136,7 @@ struct MenuItemView: View { .onHover { hovering in nameIsSelected = hovering } + .help(plainItemName) }.buttonStyle(.plain).padding(.trailing, 3) MenuItemIcons(item: item, wsURL: wsURL) } @@ -223,9 +226,12 @@ struct MenuItemIcons: View { @State private var webIsSelected: Bool = false func copyToClipboard() { - let primaryHost = item.primaryHost(hostnameSuffix: state.hostnameSuffix) NSPasteboard.general.clearContents() - NSPasteboard.general.setString(primaryHost, forType: .string) + NSPasteboard.general.setString(plainItemName, forType: .string) + } + + private var plainItemName: String { + item.primaryHost(hostnameSuffix: state.hostnameSuffix) } var body: some View {