11import { useState , useCallback } from 'react' ;
22import { createLogger } from '@automaker/utils/logger' ;
33import { useNavigate } from '@tanstack/react-router' ;
4- import { useAppStore , type ThemeMode } from '@/store/app-store' ;
4+ import { useAppStore } from '@/store/app-store' ;
55import { useOSDetection } from '@/hooks/use-os-detection' ;
66import { getElectronAPI , isElectron } from '@/lib/electron' ;
77import { initializeProject } from '@/lib/project-init' ;
@@ -76,14 +76,11 @@ export function DashboardView() {
7676
7777 const {
7878 projects,
79- trashedProjects,
80- currentProject,
8179 upsertAndSetCurrentProject,
8280 addProject,
8381 setCurrentProject,
8482 toggleProjectFavorite,
8583 moveProjectToTrash,
86- theme : globalTheme ,
8784 } = useAppStore ( ) ;
8885
8986 const [ showNewProjectModal , setShowNewProjectModal ] = useState ( false ) ;
@@ -143,12 +140,8 @@ export function DashboardView() {
143140 return ;
144141 }
145142
146- const trashedProject = trashedProjects . find ( ( p ) => p . path === path ) ;
147- const effectiveTheme =
148- ( trashedProject ?. theme as ThemeMode | undefined ) ||
149- ( currentProject ?. theme as ThemeMode | undefined ) ||
150- globalTheme ;
151- upsertAndSetCurrentProject ( path , name , effectiveTheme ) ;
143+ // Theme handling (trashed project recovery or undefined for global) is done by the store
144+ upsertAndSetCurrentProject ( path , name ) ;
152145
153146 toast . success ( 'Project opened' , {
154147 description : `Opened ${ name } ` ,
@@ -164,15 +157,7 @@ export function DashboardView() {
164157 setIsOpening ( false ) ;
165158 }
166159 } ,
167- [
168- projects ,
169- trashedProjects ,
170- currentProject ,
171- globalTheme ,
172- upsertAndSetCurrentProject ,
173- navigate ,
174- moveProjectToTrash ,
175- ]
160+ [ projects , upsertAndSetCurrentProject , navigate , moveProjectToTrash ]
176161 ) ;
177162
178163 const handleOpenProject = useCallback ( async ( ) => {
0 commit comments