From 30af888b4e10402b3cfe2ab26c02b06b0ff9b3be Mon Sep 17 00:00:00 2001 From: Lev Veyde Date: Sat, 21 Dec 2024 02:16:13 +0200 Subject: [PATCH] Fixed Chapter 09 Bug There was a bug that caused all the tasks to appear under all the projects. This patch fixes this by adding a filtering code, that displays the tasks only of the currently selected project. Signed-off-by: Lev Veyde --- .../10-finished/src/App.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/09 Practice Project - Project Management/10-finished/src/App.jsx b/code/09 Practice Project - Project Management/10-finished/src/App.jsx index 3e2513dc4..034f808f0 100644 --- a/code/09 Practice Project - Project Management/10-finished/src/App.jsx +++ b/code/09 Practice Project - Project Management/10-finished/src/App.jsx @@ -96,13 +96,17 @@ function App() { (project) => project.id === projectsState.selectedProjectId ); + const selectedProjectTasks = projectsState.tasks.filter( + (task) => task.projectId === projectsState.selectedProjectId + ); + let content = ( );