From 9a637c484bfb5b37302ca9628e87fe21a3795b20 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 5 Apr 2026 18:27:07 -0400 Subject: [PATCH] fix issue if we use `Reset Filter` showing task across project instead of default only --- src/views/Chores/MyChores.jsx | 15 ++++++--------- src/views/Chores/hooks/useChoreFilters.js | 4 +--- 2 files changed, 7 insertions(+), 12 deletions(-) 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) }