fix: loading active project was weird

This commit is contained in:
2026-02-14 16:39:27 +01:00
parent 0bdcb27410
commit 0d466b97fb
2 changed files with 6 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ export const ProjectSelector: React.FC = () => {
const [newProjectDataPath, setNewProjectDataPath] = useState<string | null>(null);
const dropdownRef = useRef<HTMLDivElement>(null);
// Load projects on mount
// Load projects on mount (active project is loaded by App.tsx)
useEffect(() => {
const loadProjects = async () => {
try {
@@ -46,16 +46,12 @@ export const ProjectSelector: React.FC = () => {
if (allProjects) {
setProjects(allProjects as ProjectData[]);
}
const active = await window.electronAPI?.projects.getActive();
if (active) {
setActiveProject(active as ProjectData);
}
} catch (error) {
console.error('Failed to load projects:', error);
}
};
loadProjects();
}, [setProjects, setActiveProject]);
}, [setProjects]);
// Close dropdown when clicking outside
useEffect(() => {