From e102abb117c5682a2f03661525825b4491209f59 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Thu, 24 Apr 2025 10:31:40 +0530 Subject: [PATCH] default project should not be set during the initial fetch. It will be set later based on specific conditions or user actions. --- src/hooks/useProjects.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/hooks/useProjects.js b/src/hooks/useProjects.js index aa5fa3f6..16af5c78 100644 --- a/src/hooks/useProjects.js +++ b/src/hooks/useProjects.js @@ -49,19 +49,19 @@ export const useProjects = () => fetchData(); }, []); - useEffect( () => - { - if (projects ) - { - if ( profile?.projects && profile?.projects?.length > 0 ) - { - dispatch(setProjectId(profile?.projects[0])) - } else - { - dispatch(setProjectId(1)) - } - } - }, [profile]); + // useEffect( () => + // { + // if (projects ) + // { + // if ( profile?.projects && profile?.projects?.length > 0 ) + // { + // dispatch(setProjectId(profile?.projects[0])) + // } else + // { + // dispatch(setProjectId(1)) + // } + // } + // }, [profile]); return { projects, loading, error, refetch: fetchData }; };