()
| 27 | }; |
| 28 | |
| 29 | const fetchUserTasks = () => { |
| 30 | const userId = user?.id || ''; |
| 31 | if (!userId || !currentWorkspace) return; |
| 32 | const currentWorkspaceTasks = currentWorkspace.projects.flatMap((project) => { |
| 33 | return project.tasks.filter((task) => task?.assignee?.id === userId); |
| 34 | }); |
| 35 | |
| 36 | setMyTasks(currentWorkspaceTasks); |
| 37 | } |
| 38 | |
| 39 | useEffect(() => { |
| 40 | fetchUserTasks() |