diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 1ee4815..a32b012 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -177,16 +177,8 @@ export default function App() { } }, []); - // Loading state - if (!workspace) { - return ( -
-
Loading workspace…
-
- ); - } - const handleCreateScratchpad = useCallback(() => { + if (!workspace) return; const singlePatterns = workspace.patterns .filter((p) => p.mode === 'single' && p.availability !== 'unavailable') .sort((a, b) => { @@ -199,7 +191,16 @@ export default function App() { if (defaultPattern) { void api.createSession({ projectId: SCRATCHPAD_PROJECT_ID, patternId: defaultPattern.id }); } - }, [api, workspace?.patterns]); + }, [api, workspace]); + + // Loading state + if (!workspace) { + return ( +
+
Loading workspace…
+
+ ); + } // Determine main content let content: React.ReactNode;