Skip to content

Commit b6cb926

Browse files
committed
fix: also remove theme calculation from dashboard-view
Missed this code path which is used when opening projects from the dashboard after completing setup.
1 parent 75fe579 commit b6cb926

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

apps/ui/src/components/views/dashboard-view.tsx

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState, useCallback } from 'react';
22
import { createLogger } from '@automaker/utils/logger';
33
import { useNavigate } from '@tanstack/react-router';
4-
import { useAppStore, type ThemeMode } from '@/store/app-store';
4+
import { useAppStore } from '@/store/app-store';
55
import { useOSDetection } from '@/hooks/use-os-detection';
66
import { getElectronAPI, isElectron } from '@/lib/electron';
77
import { 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

Comments
 (0)