The best way to control Claude Code, Codex and more from any computer or phone
web/settings: fix source control scan on relay environments (#6230)
Dominic Roy committed
Aug 12, 2026 at 19:13 UTC
da6253b3dd3a2fbf5040c236775b1c48fd757856
1 file changed
+14
-4
apps/web/src/components/settings/SourceControlSettings.tsx
+14
-4
@@ -19,7 +19,7 @@ import {
19
20
import { usePrimarySettings, useUpdatePrimarySettings } from "../../hooks/useSettings";
21
import { cn } from "../../lib/utils";
22
-import { usePrimaryEnvironment } from "../../state/environments";
22
+import { useEnvironments, usePrimaryEnvironment } from "../../state/environments";
23
import { useEnvironmentQuery } from "../../state/query";
24
import { sourceControlEnvironment } from "../../state/sourceControl";
25
import { Badge } from "../ui/badge";
@@ -508,7 +508,15 @@ function EmptySourceControlDiscovery({
508
}
509
510
export function SourceControlSettingsPanel() {
511
- const environmentId = usePrimaryEnvironment()?.environmentId ?? null;
511
+ const { environments } = useEnvironments();
512
+ const primaryEnvironment = usePrimaryEnvironment();
513
+ const fallbackEnvironment =
514
+ environments.find((environment) => environment.connection.phase === "connected") ??
515
+ environments[0] ??
516
+ null;
517
+ const environmentId =
518
+ primaryEnvironment?.environmentId ?? fallbackEnvironment?.environmentId ?? null;
519
+ const isPrimaryEnvironment = environmentId === primaryEnvironment?.environmentId;
520
const discovery = useEnvironmentQuery(
521
environmentId === null
522
? null
@@ -561,7 +569,9 @@ export function SourceControlSettingsPanel() {
569
>
570
{result.versionControlSystems.map((item) => (
571
<DiscoveryItemRow key={`vcs:${item.kind}`} item={item}>
564
- {item.kind === "git" ? <GitFetchIntervalSettings /> : undefined}
572
+ {item.kind === "git" && isPrimaryEnvironment ? (
573
+ <GitFetchIntervalSettings />
574
+ ) : undefined}
575
</DiscoveryItemRow>
576
))}
577
</SettingsSection>
@@ -587,7 +597,7 @@ export function SourceControlSettingsPanel() {
597
/>
598
)}
599
590
- {environmentId !== null ? <SourceControlWritingSettingsSection /> : null}
600
+ {isPrimaryEnvironment ? <SourceControlWritingSettingsSection /> : null}
601
</SettingsPageContainer>
602
);
603
}