Skip to content

Commit cc85d70

Browse files
committed
fix(web): distinguish hosted archive topology
1 parent 5d28c43 commit cc85d70

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

apps/web/src/archiveProjectFiltering.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,17 @@ describe("archive project filtering", () => {
185185
archiveError: null,
186186
archivesReady: true,
187187
environmentsReady: true,
188-
hasProjectGroups: true,
188+
environmentTopologyReady: true,
189189
isLoadingArchive: false,
190190
settingsHydrated: true,
191191
};
192192

193193
expect(canValidateArchivedProjectKey(ready)).toBe(true);
194194
expect(canValidateArchivedProjectKey({ ...ready, archivesReady: false })).toBe(false);
195195
expect(canValidateArchivedProjectKey({ ...ready, environmentsReady: false })).toBe(false);
196-
expect(canValidateArchivedProjectKey({ ...ready, hasProjectGroups: false })).toBe(false);
196+
expect(canValidateArchivedProjectKey({ ...ready, environmentTopologyReady: false })).toBe(
197+
false,
198+
);
197199
expect(canValidateArchivedProjectKey({ ...ready, settingsHydrated: false })).toBe(false);
198200
expect(canValidateArchivedProjectKey({ ...ready, isLoadingArchive: true })).toBe(false);
199201
expect(canValidateArchivedProjectKey({ ...ready, archiveError: "Failed" })).toBe(false);

apps/web/src/archiveProjectFiltering.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ export function canValidateArchivedProjectKey(input: {
9999
readonly archiveError: string | null;
100100
readonly archivesReady: boolean;
101101
readonly environmentsReady: boolean;
102-
readonly hasProjectGroups: boolean;
102+
readonly environmentTopologyReady: boolean;
103103
readonly isLoadingArchive: boolean;
104104
readonly settingsHydrated: boolean;
105105
}): boolean {
106106
return (
107107
input.environmentsReady &&
108-
input.hasProjectGroups &&
108+
input.environmentTopologyReady &&
109109
input.settingsHydrated &&
110110
input.archivesReady &&
111111
!input.isLoadingArchive &&

apps/web/src/lib/archivedThreadsState.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { orchestrationEnvironment } from "../state/orchestration";
1717
import { appAtomRegistry } from "../rpc/atomRegistry";
1818
import { useProjects } from "../state/entities";
1919
import { useEnvironments, usePrimaryEnvironmentId } from "../state/environments";
20+
import { isHostedStaticApp } from "../hostedPairing";
2021

2122
function archivedSnapshotAtom(environmentId: EnvironmentId) {
2223
return orchestrationEnvironment.archivedShellSnapshot({
@@ -97,13 +98,18 @@ export function useArchivedProjectModel() {
9798
resolveEnvironmentLabel: (environmentId) => environmentLabelById.get(environmentId) ?? null,
9899
});
99100
}, [archiveState.snapshots, environmentLabelById, primaryEnvironmentId, projectGroupingSettings]);
101+
const environmentTopologyReady = isHostedStaticApp() || primaryEnvironmentId !== null;
100102
const isLoading =
101-
archiveState.isLoading || !archiveState.isReady || !environmentsReady || !settingsHydrated;
103+
archiveState.isLoading ||
104+
!archiveState.isReady ||
105+
!environmentsReady ||
106+
!environmentTopologyReady ||
107+
!settingsHydrated;
102108
const canValidateProjectKey = canValidateArchivedProjectKey({
103109
archiveError: archiveState.error,
104110
archivesReady: archiveState.isReady,
105111
environmentsReady,
106-
hasProjectGroups: model.projectGroups.length > 0,
112+
environmentTopologyReady,
107113
isLoadingArchive: archiveState.isLoading,
108114
settingsHydrated,
109115
});

0 commit comments

Comments
 (0)