Skip to content

Commit a5c98e7

Browse files
fix(settings): allow device host edits with offline environments
1 parent ac322ca commit a5c98e7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎apps/web/src/components/settings/DeviceHostsSettings.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ export function DeviceHostsSettings(props: { environmentId: EnvironmentId | null
5454
const hostDestinations = environments.filter(
5555
(environment) => !environment.unsupportedSettingKeys.has("deviceHosts"),
5656
);
57-
const writableIds = useEnvironmentsWithScope(hostDestinations, AuthSettingsWriteScope);
57+
const connectedHostDestinations = hostDestinations.filter(
58+
(environment) =>
59+
environment.connection.phase === "connected" && environment.serverConfig !== null,
60+
);
61+
const writableIds = useEnvironmentsWithScope(connectedHostDestinations, AuthSettingsWriteScope);
5862
const canConfigure =
59-
hostDestinations.length > 0 &&
60-
hostDestinations.every((environment) => writableIds.has(environment.environmentId));
63+
connectedHostDestinations.length > 0 &&
64+
connectedHostDestinations.every((environment) => writableIds.has(environment.environmentId));
6165
const targets = hostDestinations.map((environment) => ({
6266
environmentId: environment.environmentId,
6367
label: settingsScopeEnvironmentLabel(environment, environments),

0 commit comments

Comments
 (0)