Skip to content
Merged
Changes from 1 commit
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
14 changes: 5 additions & 9 deletions apps/web/src/routes/_chat.index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ function IndexDraftLanding() {
const [startState, setStartState] = useState({ failed: false, retryRequest: 0 });

const mostRecentProject = useMemo(
() =>
bootstrapped
? (sortScopedProjectsForSidebar(projects, threads, "updated_at")[0] ?? null)
: null,
[bootstrapped, projects, threads],
() => sortScopedProjectsForSidebar(projects, threads, "updated_at")[0] ?? null,
[projects, threads],
);

useEffect(() => {
Expand All @@ -78,9 +75,6 @@ function IndexDraftLanding() {
});
}, [handleNewThread, mostRecentProject, startState.retryRequest]);

if (!bootstrapped) {
return null;
}
if (mostRecentProject !== null) {
return startState.failed ? (
<DraftStartError
Expand All @@ -93,7 +87,9 @@ function IndexDraftLanding() {
/>
) : null;
}
return <NoProjectsHero />;
// A pending environment cannot prove the workspace is empty, but must not
// prevent opening a draft in a project that has already loaded.
return bootstrapped ? <NoProjectsHero /> : null;
}

function DraftStartError({ onRetry }: { readonly onRetry: () => void }) {
Expand Down
Loading