From cbeefbfa5a2743b4e32f602ee54034b6175aea40 Mon Sep 17 00:00:00 2001 From: dotta Date: Sat, 28 Mar 2026 11:31:38 -0500 Subject: [PATCH] Fix project workspace detail route loading Co-Authored-By: Paperclip --- ui/src/App.tsx | 2 ++ ui/src/pages/ProjectWorkspaceDetail.tsx | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/src/App.tsx b/ui/src/App.tsx index ac1e6040..004baad2 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -340,6 +340,8 @@ export function App() { } /> } /> } /> + } /> + } /> } /> } /> }> diff --git a/ui/src/pages/ProjectWorkspaceDetail.tsx b/ui/src/pages/ProjectWorkspaceDetail.tsx index 1a3411e0..b7c59011 100644 --- a/ui/src/pages/ProjectWorkspaceDetail.tsx +++ b/ui/src/pages/ProjectWorkspaceDetail.tsx @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from "react"; import { Link, useNavigate, useParams } from "@/lib/router"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import type { ProjectWorkspace } from "@paperclipai/shared"; +import { isUuidLike, type ProjectWorkspace } from "@paperclipai/shared"; import { ArrowLeft, Check, ExternalLink, Loader2, Sparkles } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; @@ -186,10 +186,11 @@ export function ProjectWorkspaceDetail() { }, [companies, companyPrefix]); const lookupCompanyId = routeCompanyId ?? selectedCompanyId ?? undefined; + const canFetchProject = routeProjectRef.length > 0 && (isUuidLike(routeProjectRef) || Boolean(lookupCompanyId)); const projectQuery = useQuery({ queryKey: [...queryKeys.projects.detail(routeProjectRef), lookupCompanyId ?? null], queryFn: () => projectsApi.get(routeProjectRef, lookupCompanyId), - enabled: routeProjectRef.length > 0, + enabled: canFetchProject, }); const project = projectQuery.data ?? null;