From a02d6555de2f381409f9fc10b1aa941536de0e07 Mon Sep 17 00:00:00 2001 From: Birdup <34012548+birdup000@users.noreply.github.com> Date: Sun, 22 Dec 2024 19:05:53 -0600 Subject: [PATCH] Modified app/components/TaskPanel.tsx --- app/components/TaskPanel.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/components/TaskPanel.tsx b/app/components/TaskPanel.tsx index 92bc868..46f98bd 100644 --- a/app/components/TaskPanel.tsx +++ b/app/components/TaskPanel.tsx @@ -69,8 +69,8 @@ const TaskPanel: React.FC = () => { filteredAndSortedTasks } = useSearch(tasks); - useEffect(() => { - const initializePanel = async () => { +useEffect(() =>{ + const initializePanel = async () =>{ try { setMounted(true); console.log('TaskPanel: Initializing with auth state:', { token, noAuth }); @@ -81,7 +81,14 @@ const TaskPanel: React.FC = () => { return; } - await new Promise(resolve => setTimeout(resolve, 100)); + // Immediately initialize if noAuth is true + if (noAuth) { + setIsInitialized(true); + console.log('TaskPanel: Initialization complete (noAuth)'); + return; + } + + await new Promise(resolve =>setTimeout(resolve, 100)); setIsInitialized(true); console.log('TaskPanel: Initialization complete'); } catch (err) {