diff --git a/packages/app/src/settings/shell.tsx b/packages/app/src/settings/shell.tsx index 55345202112..12646486f2e 100644 --- a/packages/app/src/settings/shell.tsx +++ b/packages/app/src/settings/shell.tsx @@ -237,9 +237,11 @@ function RootSettings() { ...serverTabs.map((item) => ({ ...item, label: language.t(item.label), - disabled: !single() || (item.value === "pairing" && !!singleEntry()?.ssh), + disabled: + !single() || + (item.value === "pairing" && (singleEntry()?.connection?.type === "ssh" || !!singleEntry()?.ssh)), tooltip: - item.value === "pairing" && singleEntry()?.ssh + item.value === "pairing" && (singleEntry()?.connection?.type === "ssh" || singleEntry()?.ssh) ? language.t("settings.pairing.sshUnavailable") : undefined, onPrefetch: item.value === "workspaces" ? prefetchWorkspaces : undefined, @@ -259,7 +261,12 @@ function RootSettings() { }) createEffect(() => { const view = surface.view() - if (view.type === "root" && view.tab === "pairing" && singleEntry()?.ssh) surface.open("general") + if ( + view.type === "root" && + view.tab === "pairing" && + (singleEntry()?.connection?.type === "ssh" || singleEntry()?.ssh) + ) + surface.open("general") }) const change = (value: string) => { @@ -358,15 +365,23 @@ function ServerSettings(props: { entry: SettingsServer }) { ...item, label: item.value === "general" ? props.entry.name : language.t(item.label), disabled: - item.value !== "general" && (!props.entry.connection || (item.value === "pairing" && !!props.entry.ssh)), + item.value !== "general" && + (!props.entry.connection || + (item.value === "pairing" && (props.entry.connection.type === "ssh" || !!props.entry.ssh))), tooltip: - item.value === "pairing" && props.entry.ssh ? language.t("settings.pairing.sshUnavailable") : undefined, + item.value === "pairing" && (props.entry.connection?.type === "ssh" || props.entry.ssh) + ? language.t("settings.pairing.sshUnavailable") + : undefined, onPrefetch: item.value === "workspaces" ? prefetchWorkspaces : undefined, })), }, ]) createEffect(() => { - if ((!props.entry.connection || props.entry.ssh) && surface.view().tab === "pairing") surface.select("general") + if ( + (!props.entry.connection || props.entry.connection.type === "ssh" || props.entry.ssh) && + surface.view().tab === "pairing" + ) + surface.select("general") if (!props.entry.connection && surface.view().tab !== "general") surface.select("general") }) const change = (value: string) => { diff --git a/packages/app/src/shell/commands/desktop.tsx b/packages/app/src/shell/commands/desktop.tsx index cdaf3370284..0c028873d57 100644 --- a/packages/app/src/shell/commands/desktop.tsx +++ b/packages/app/src/shell/commands/desktop.tsx @@ -51,14 +51,17 @@ export function DesktopPairingCommand() { const servers = useSettingsServers() command.register("desktop-pairing", () => - platform.platform === "desktop" && servers().some((server) => server.connection && !server.ssh) + platform.platform === "desktop" && + servers().some((server) => server.connection && server.connection.type !== "ssh" && !server.ssh) ? [ { id: "server.pair", title: language.t("command.server.pair"), category: language.t("command.category.server"), onSelect: () => { - const server = servers().find((item) => item.connection && !item.ssh) + const server = servers().find( + (item) => item.connection && item.connection.type !== "ssh" && !item.ssh, + ) if (server) settings.openServer(server.key, "pairing") }, },