Skip to content

Commit 2ba046f

Browse files
committed
fix(web): simplify Tailscale detection guidance and cover disabled access
1 parent d2443b9 commit 2ba046f

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎apps/web/src/components/settings/ConnectionsSettings.logic.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ describe("missingTailscaleEndpointDescription", () => {
143143
);
144144
});
145145

146+
it("keeps detection-off guidance when Network access is off, even with a cached IP", () => {
147+
expect(
148+
missingTailscaleEndpointDescription({ mode: "local-only", tailscaleServeEnabled: false }, [
149+
tailscaleIp,
150+
]),
151+
).toBe("Turn on Network access to detect Tailscale.");
152+
});
153+
146154
it("asks to start Tailscale when no Tailscale address is present", () => {
147155
expect(missingTailscaleEndpointDescription(networkAccessible, [])).toBe(
148156
"Start Tailscale to set up HTTPS access through MagicDNS.",

‎apps/web/src/components/settings/ConnectionsSettings.logic.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ export function missingTailscaleEndpointDescription(
6666
if (state && state.mode !== "network-accessible" && !state.tailscaleServeEnabled) {
6767
return "Turn on Network access to detect Tailscale.";
6868
}
69-
// The Tailscale IP comes from the network adapter, but the MagicDNS name
70-
// needs `tailscale status`. An IP alone means Tailscale is running and the
71-
// CLI could not be used: on macOS it is often missing from the app's PATH.
72-
return endpoints.some(isTailscaleIpEndpoint)
69+
return endpoints.some((endpoint) => endpoint.id.startsWith("tailscale-ip:"))
7370
? "Tailscale is running, but its MagicDNS name could not be read. Make sure the tailscale command is installed and MagicDNS is on."
7471
: "Start Tailscale to set up HTTPS access through MagicDNS.";
7572
}
@@ -363,10 +360,6 @@ export function isTailscaleHttpsEndpoint(endpoint: AdvertisedEndpoint): boolean
363360
return endpoint.id.startsWith("tailscale-magicdns:");
364361
}
365362

366-
function isTailscaleIpEndpoint(endpoint: AdvertisedEndpoint): boolean {
367-
return endpoint.id.startsWith("tailscale-ip:");
368-
}
369-
370363
export function endpointDefaultPreferenceKey(endpoint: AdvertisedEndpoint): string {
371364
if (endpoint.id.startsWith("desktop-loopback:")) {
372365
return "desktop-core:loopback:http";

0 commit comments

Comments
 (0)