fix issue if we use Reset Filter showing task across project instead of default only

This commit is contained in:
Mo Tarbin
2026-04-05 18:27:07 -04:00
parent 175ef04c70
commit 9a637c484b
2 changed files with 7 additions and 12 deletions

View File

@@ -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(

View File

@@ -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)
}