diff --git a/src/views/Chores/MyChores.jsx b/src/views/Chores/MyChores.jsx index d57c099..b3c4e4d 100644 --- a/src/views/Chores/MyChores.jsx +++ b/src/views/Chores/MyChores.jsx @@ -221,15 +221,12 @@ const MyChores = () => { let choresToGroup = chores if (tempFilter || activeFilterId) { choresToGroup = customFilteredChores - } else if (selectedProject) { - // Otherwise, use project-filtered chores for section grouping - if (selectedProject.id === 'default') { - // Default project: only show tasks without a projectId - choresToGroup = chores.filter(chore => !chore.projectId) - } else { - // Other projects: use the existing filter function - choresToGroup = filterByProject(chores, selectedProject.id) - } + } else if (!selectedProject || selectedProject.id === 'default') { + // No project selected or default project: only show tasks without a projectId + choresToGroup = chores.filter(chore => !chore.projectId) + } else { + // Specific project: use the existing filter function + choresToGroup = filterByProject(chores, selectedProject.id) } const sections = ChoresGrouper( diff --git a/src/views/Chores/hooks/useChoreFilters.js b/src/views/Chores/hooks/useChoreFilters.js index 8153f1d..e30bb32 100644 --- a/src/views/Chores/hooks/useChoreFilters.js +++ b/src/views/Chores/hooks/useChoreFilters.js @@ -15,9 +15,7 @@ export const useChoreFilters = ({ ) const projectFilteredChores = useMemo(() => { - if (!selectedProject) return chores - - if (selectedProject.id === 'default') { + if (!selectedProject || selectedProject.id === 'default') { return chores.filter(chore => !chore.projectId) }