Compare commits
No commits in common. "a2f6d77dcdcb15af20f2ce0d777de14165e47e4e" and "b30f3b8d98a4a58aea03c39e6537c953c222d883" have entirely different histories.
a2f6d77dcd
...
b30f3b8d98
@ -49,19 +49,19 @@ export const useProjects = () =>
|
|||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// useEffect( () =>
|
useEffect( () =>
|
||||||
// {
|
{
|
||||||
// if (projects )
|
if (projects )
|
||||||
// {
|
{
|
||||||
// if ( profile?.projects && profile?.projects?.length > 0 )
|
if ( profile?.projects && profile?.projects?.length > 0 )
|
||||||
// {
|
{
|
||||||
// dispatch(setProjectId(profile?.projects[0]))
|
dispatch(setProjectId(profile?.projects[0]))
|
||||||
// } else
|
} else
|
||||||
// {
|
{
|
||||||
// dispatch(setProjectId(1))
|
dispatch(setProjectId(1))
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }, [profile]);
|
}, [profile]);
|
||||||
|
|
||||||
return { projects, loading, error, refetch: fetchData };
|
return { projects, loading, error, refetch: fetchData };
|
||||||
};
|
};
|
||||||
|
@ -34,7 +34,7 @@ const DailyTask = () => {
|
|||||||
|
|
||||||
// Sync projectId (either from URL or pick first accessible one)
|
// Sync projectId (either from URL or pick first accessible one)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!project_lodaing && projects.length > 0 && !initialized) {
|
if (!project_lodaing && projects.length > 0) {
|
||||||
const userProjects = projects.filter((p) =>
|
const userProjects = projects.filter((p) =>
|
||||||
LoggedUser?.projects?.map(Number).includes(p.id)
|
LoggedUser?.projects?.map(Number).includes(p.id)
|
||||||
);
|
);
|
||||||
@ -45,10 +45,9 @@ const DailyTask = () => {
|
|||||||
dispatch(setProjectId(userProjects[0].id));
|
dispatch(setProjectId(userProjects[0].id));
|
||||||
}
|
}
|
||||||
|
|
||||||
setInitialized(true); // <-- This blocks re-running this effect again
|
setInitialized(true);
|
||||||
}
|
}
|
||||||
}, [project_lodaing, projects, projectId, selectedProject, initialized]);
|
}, [project_lodaing, projects, projectId, selectedProject]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const dispatch = useDispatch(selectedProject);
|
const dispatch = useDispatch(selectedProject);
|
||||||
@ -59,15 +58,13 @@ const DailyTask = () => {
|
|||||||
loading: task_loading,
|
loading: task_loading,
|
||||||
error: task_error,
|
error: task_error,
|
||||||
refetch,
|
refetch,
|
||||||
} = useTaskList( initialized ? selectedProject : null,
|
} = useTaskList(selectedProject, dateRange.startDate, dateRange.endDate);
|
||||||
initialized ? dateRange.startDate : null,
|
|
||||||
initialized ? dateRange.endDate : null);
|
|
||||||
|
|
||||||
const [TaskLists, setTaskLists] = useState([]);
|
const [TaskLists, setTaskLists] = useState([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTaskLists(TaskList);
|
setTaskLists(TaskList);
|
||||||
}, [TaskList,selectedProject]);
|
}, [TaskList, selectedProject]);
|
||||||
|
|
||||||
const [selectedTask, selectTask] = useState(null);
|
const [selectedTask, selectTask] = useState(null);
|
||||||
const [comments, setComment] = useState(null);
|
const [comments, setComment] = useState(null);
|
||||||
|
@ -293,7 +293,7 @@ const EmployeeList = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<table
|
<table
|
||||||
className="datatables-users table border-top dataTable no-footer dtr-column text-nowrap"
|
className="datatables-users table border-top dataTable no-footer dtr-column "
|
||||||
id="DataTables_Table_0"
|
id="DataTables_Table_0"
|
||||||
aria-describedby="DataTables_Table_0_info"
|
aria-describedby="DataTables_Table_0_info"
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user