refactor: straightened logic, replaces throttle with mantine debounced

This commit is contained in:
2025-08-05 17:47:39 +04:00
parent c13cc4a0a5
commit abbf782945
7 changed files with 37 additions and 68 deletions

View File

@ -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]);

View File

@ -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]);

View File

@ -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]);