Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,31 @@ export function ImportWorkspacesPage({
});

const v2ProjectIdByV1Id = useMemo(() => {
const projectIdsInCloud = new Set(
(cloudWorkspacesQuery.data ?? []).map((w) => w.projectId),
);
const v2ByPath = new Map<string, string>();
for (const v2 of hostProjectListQuery.data ?? []) {
v2ByPath.set(v2.repoPath, v2.id);
const existing = v2ByPath.get(v2.repoPath);
if (!existing) {
v2ByPath.set(v2.repoPath, v2.id);
continue;
}
if (projectIdsInCloud.has(v2.id) && !projectIdsInCloud.has(existing)) {
v2ByPath.set(v2.repoPath, v2.id);
}
}
const map = new Map<string, string>();
for (const v1 of projectsQuery.data ?? []) {
const v2Id = v2ByPath.get(v1.mainRepoPath);
if (v2Id) map.set(v1.id, v2Id);
}
return map;
}, [hostProjectListQuery.data, projectsQuery.data]);
}, [
hostProjectListQuery.data,
projectsQuery.data,
cloudWorkspacesQuery.data,
]);

const cloudWorkspaceKeys = useMemo(() => {
const set = new Set<string>();
Expand Down Expand Up @@ -108,6 +122,7 @@ export function ImportWorkspacesPage({
workspacesQuery.isPending ||
worktreesQuery.isPending ||
hostProjectListQuery.isPending ||
cloudWorkspacesQuery.isPending ||
worktreeListQueries.some((q) => q.isPending);

const [isRefreshing, setIsRefreshing] = useState(false);
Expand Down
Loading