| ... | ... | @@ -963,21 +963,23 @@ function OpenCommandPaletteDialog(props: { |
| 963 | 963 | ); |
| 964 | 964 | |
| 965 | 965 | const addProjectEnvironmentOptions = useMemo(() => { |
| 966 | | const options = environments.map((environment): AddProjectEnvironmentOption => { |
| 967 | | const isPrimary = environment.entry.target._tag === "PrimaryConnectionTarget"; |
| 968 | | return { |
| 969 | | environmentId: environment.environmentId, |
| 970 | | label: resolveEnvironmentOptionLabel({ |
| 971 | | isPrimary, |
| 966 | const options = environments |
| 967 | .filter((environment) => canCreateProjectInEnvironment(environment.connection.phase)) |
| 968 | .map((environment): AddProjectEnvironmentOption => { |
| 969 | const isPrimary = environment.entry.target._tag === "PrimaryConnectionTarget"; |
| 970 | return { |
| 972 | 971 | environmentId: environment.environmentId, |
| 973 | | runtimeLabel: environment.label, |
| 974 | | }), |
| 975 | | isPrimary, |
| 976 | | machine: resolveEnvironmentMachineKind(environment.serverConfig), |
| 977 | | isConnected: canCreateProjectInEnvironment(environment.connection.phase), |
| 978 | | status: connectionStatusText(environment.connection), |
| 979 | | }; |
| 980 | | }); |
| 972 | label: resolveEnvironmentOptionLabel({ |
| 973 | isPrimary, |
| 974 | environmentId: environment.environmentId, |
| 975 | runtimeLabel: environment.label, |
| 976 | }), |
| 977 | isPrimary, |
| 978 | machine: resolveEnvironmentMachineKind(environment.serverConfig), |
| 979 | isConnected: canCreateProjectInEnvironment(environment.connection.phase), |
| 980 | status: connectionStatusText(environment.connection), |
| 981 | }; |
| 982 | }); |
| 981 | 983 | |
| 982 | 984 | options.sort((left, right) => { |
| 983 | 985 | if (left.isPrimary !== right.isPrimary) { |
| ... | ... | @@ -1658,7 +1660,7 @@ function OpenCommandPaletteDialog(props: { |
| 1658 | 1660 | ); |
| 1659 | 1661 | |
| 1660 | 1662 | const openAddProjectFlow = useCallback(() => { |
| 1661 | | // With no environment at all there is nothing to browse, so the only |
| 1663 | // With no connected environment there is nothing to browse, so the only |
| 1662 | 1664 | // useful next step is connecting one. |
| 1663 | 1665 | if (addProjectEnvironmentOptions.length === 0) { |
| 1664 | 1666 | setOpen(false); |