Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ const Layout = () => {
const shouldShowOnboarding =
initState === 'done' && isFirstLaunch && !isInstalling;

// Don't show install screen solely due to waiting-backend when already "done"
// (avoids race where setWaitingBackend() runs after content has rendered)
const actualShouldShowInstallScreen =
shouldShowInstallScreen ||
initState !== 'done' ||
installationState === 'waiting-backend';
shouldShowInstallScreen || initState !== 'done';
const shouldShowMainContent = !actualShouldShowInstallScreen;

if (!chatStore) {
Expand Down
19 changes: 15 additions & 4 deletions src/hooks/useInstallationSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,21 @@ export const useInstallationSetup = () => {
installationCompleted.current = true;
backendReady.current = false;

// Set to waiting-backend state
setWaitingBackend();
// Only show install screen when not already "done" to avoid layout visibility race
if (initState !== 'done') {
setWaitingBackend();
}

// Start polling for backend
startBackendPolling();
}
}, [needsBackendRestart, email, setWaitingBackend, startBackendPolling]);
}, [
needsBackendRestart,
email,
initState,
setWaitingBackend,
startBackendPolling,
]);

useEffect(() => {
if (hasCheckedOnMount.current) {
Expand All @@ -178,7 +186,10 @@ export const useInstallationSetup = () => {
'[useInstallationSetup] Tools already installed, waiting for backend'
);
installationCompleted.current = true;
setWaitingBackend();
// Only show install screen when not already "done" to avoid layout visibility race
if (initState !== 'done') {
setWaitingBackend();
}

// Start polling for backend when tools are already installed
startBackendPolling();
Expand Down