From ac7e8c03afeb4532d28243f7de6500b9c6e50798 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Fri, 16 Jan 2026 02:05:30 +0000 Subject: [PATCH] Generated by Spark: Fix all reported errors. --- src/App.tsx | 8 +++++++- src/components/ProjectDashboard.tsx | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 55ccb63..b73eed8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -156,7 +156,7 @@ function App() { const safeFiles = files || [] const safeModels = models || [] const safeComponents = components || [] - const safeTheme = theme || DEFAULT_THEME + const safeTheme = (theme && theme.variants && theme.variants.length > 0) ? theme : DEFAULT_THEME const safePlaywrightTests = playwrightTests || [] const safeStorybookStories = storybookStories || [] const safeUnitTests = unitTests || [] @@ -164,6 +164,12 @@ function App() { const safeNextjsConfig = nextjsConfig || DEFAULT_NEXTJS_CONFIG const safeNpmSettings = npmSettings || DEFAULT_NPM_SETTINGS + useEffect(() => { + if (!theme || !theme.variants || theme.variants.length === 0) { + setTheme(DEFAULT_THEME) + } + }, [theme, setTheme]) + const { errors: autoDetectedErrors } = useAutoRepair(safeFiles, false) useKeyboardShortcuts([ diff --git a/src/components/ProjectDashboard.tsx b/src/components/ProjectDashboard.tsx index d7813f7..4b43870 100644 --- a/src/components/ProjectDashboard.tsx +++ b/src/components/ProjectDashboard.tsx @@ -39,7 +39,7 @@ export function ProjectDashboard({ const totalFiles = files.length const totalModels = models.length const totalComponents = components.length - const totalThemeVariants = theme.variants.length + const totalThemeVariants = theme?.variants?.length || 0 const totalEndpoints = flaskConfig.blueprints.reduce((acc, bp) => acc + bp.endpoints.length, 0) const totalTests = playwrightTests.length + storybookStories.length + unitTests.length