@@ -52,6 +52,19 @@ export default function TaskListContainer({bodyshop, titleTranslation ,query, r
|
||||
};
|
||||
}, [refetch]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleTaskUpdated = (event) => {
|
||||
refetch();
|
||||
};
|
||||
|
||||
window.addEventListener('taskUpdated', handleTaskUpdated);
|
||||
|
||||
// Clean up the event listener when the component is unmounted.
|
||||
return () => {
|
||||
window.removeEventListener('taskUpdated', handleTaskUpdated);
|
||||
};
|
||||
}, [refetch]);
|
||||
|
||||
/**
|
||||
* Toggle task completed mutation
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user