From b0dc1bec11a8e0ac4f065439659eaa076f91682f Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Wed, 17 Sep 2025 14:46:27 +0200 Subject: [PATCH] fix: add active filters count to context and components - Integrated activeFiltersCount into useTasksContext for HomePageContent and KanbanFilters. - Removed redundant activeFiltersCount calculation from KanbanFilters, leveraging the context instead for better performance and consistency. --- components/HomePageClient.tsx | 4 ++-- components/kanban/KanbanFilters.tsx | 11 +---------- src/contexts/TasksContext.tsx | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/components/HomePageClient.tsx b/components/HomePageClient.tsx index 709145a..fd6576f 100644 --- a/components/HomePageClient.tsx +++ b/components/HomePageClient.tsx @@ -19,7 +19,7 @@ interface HomePageClientProps { function HomePageContent() { - const { stats, syncing, createTask } = useTasksContext(); + const { stats, syncing, createTask, activeFiltersCount } = useTasksContext(); const { preferences, updateViewPreferences } = useUserPreferences(); const [isCreateModalOpen, setIsCreateModalOpen] = useState(false); @@ -78,7 +78,7 @@ function HomePageContent() { - Filtres + Filtres{activeFiltersCount > 0 && ` (${activeFiltersCount})`}