Skip to content
TypeScript

fix(web): open the startup composer without waiting for every environment (#20183)

Shantanu Wable3c63b50b87d8
diff --git a/apps/web/src/routes/_chat.index.tsx b/apps/web/src/routes/_chat.index.tsx
index b121de4837d..ccb34b24582 100644
--- a/apps/web/src/routes/_chat.index.tsx
+++ b/apps/web/src/routes/_chat.index.tsx
@@ -41,13 +41,11 @@ function IndexDraftLanding() {
// Read at effect time: this page stays mounted while a navigation away from
// "/" is still loading, but the router already points at the new location.
const isStillOnIndex = useEffectEvent(() => router.state.location.pathname === "/");
- // One start per attempt; a retry request opens the next attempt.
const startedAttemptRef = useRef<number | null>(null);
const [startState, setStartState] = useState({ failed: false, retryRequest: 0 });
- const mostRecentProject = bootstrapped
- ? (sortScopedProjectsForSidebar(projects, threads, "updated_at")[0] ?? null)
- : null;
+ const mostRecentProject =
+ sortScopedProjectsForSidebar(projects, threads, "updated_at")[0] ?? null;
const attempt = startState.retryRequest;
useEffect(() => {
@@ -71,9 +69,6 @@ function IndexDraftLanding() {
});
}, [attempt, handleNewThread, mostRecentProject]);
- if (!bootstrapped) {
- return null;
- }
if (mostRecentProject !== null) {
return startState.failed ? (
<DraftStartError
@@ -86,7 +81,8 @@ function IndexDraftLanding() {
/>
) : null;
}
- return <NoProjectsHero />;
+ // A pending environment cannot prove the workspace is empty.
+ return bootstrapped ? <NoProjectsHero /> : null;
}
function DraftStartError({ onRetry }: { readonly onRetry: () => void }) {