From 23131d686aec2de82af98ab44c257148545cba77 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 10 Mar 2026 18:37:07 +0200 Subject: [PATCH] Fix sidebar toggle causing unnecessary task list reload (#888) (#937) Remove isSidebarOpen from the useEffect dependency array and from the API request parameters in Tasks.tsx. The sidebar visibility state has no bearing on which tasks should be fetched, so toggling it should not trigger a data re-fetch. --- frontend/components/Tasks.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/components/Tasks.tsx b/frontend/components/Tasks.tsx index 7248e5d..08dd3c5 100644 --- a/frontend/components/Tasks.tsx +++ b/frontend/components/Tasks.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useState, useRef, useMemo } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { useSidebar } from '../contexts/SidebarContext'; import TaskList from './Task/TaskList'; import GroupedTaskList from './Task/GroupedTaskList'; import NewTask from './Task/NewTask'; @@ -40,7 +39,7 @@ const getSearchPlaceholder = (language: string): string => { const Tasks: React.FC = () => { const { t, i18n } = useTranslation(); const { showSuccessToast } = useToast(); - const { isSidebarOpen } = useSidebar(); + const [tasks, setTasks] = useState([]); const projects = useStore((state: any) => state.projectsStore.projects); const [groupedTasks, setGroupedTasks] = useState(null); @@ -197,7 +196,6 @@ const Tasks: React.FC = () => { allTasksUrl.set('type', 'upcoming'); allTasksUrl.set('groupBy', 'day'); allTasksUrl.set('maxDays', '7'); - allTasksUrl.set('sidebarOpen', isSidebarOpen.toString()); allTasksUrl.set('isMobile', isMobile.toString()); } @@ -312,7 +310,7 @@ const Tasks: React.FC = () => { } : undefined ); - }, [location, isSidebarOpen, isMobile, groupBy, isUpcomingView]); + }, [location, isMobile, groupBy, isUpcomingView]); useEffect(() => { const handleResize = () => {