refactor: straightened logic, replaces throttle with mantine debounced
This commit is contained in:
@ -18,7 +18,9 @@ const useBoardsList = ({ projectId }: Props) => {
|
||||
useEffect(() => {
|
||||
if (projectId === undefined) {
|
||||
setBoards([]);
|
||||
} else if (data?.boards) {
|
||||
return;
|
||||
}
|
||||
if (data?.boards) {
|
||||
setBoards(data.boards);
|
||||
}
|
||||
}, [data?.boards, projectId]);
|
||||
|
||||
@ -18,7 +18,9 @@ const useDealsList = ({ boardId }: Props) => {
|
||||
useEffect(() => {
|
||||
if (boardId === undefined) {
|
||||
setDeals([]);
|
||||
} else if (data?.deals) {
|
||||
return;
|
||||
}
|
||||
if (data?.deals) {
|
||||
setDeals(data.deals);
|
||||
}
|
||||
}, [data?.deals, boardId]);
|
||||
|
||||
@ -18,7 +18,9 @@ const useStatusesList = ({ boardId }: Props) => {
|
||||
useEffect(() => {
|
||||
if (boardId === undefined) {
|
||||
setStatuses([]);
|
||||
} else if (data?.statuses) {
|
||||
return;
|
||||
}
|
||||
if (data?.statuses) {
|
||||
setStatuses(data.statuses);
|
||||
}
|
||||
}, [data?.statuses, boardId]);
|
||||
|
||||
Reference in New Issue
Block a user