From 4d74a723b1f5a75cd440f2b9d89b3b0ca18b8e06 Mon Sep 17 00:00:00 2001 From: ALi Josheghani Date: Wed, 16 Oct 2024 14:14:28 +0330 Subject: [PATCH] feat: Update active tutorial state initialization Update the initialization of the activeTutorial state in the Tutorials component to set it to 8 instead of 2. This ensures that the correct tutorial is displayed when the category ID changes. Removed an empty useEffect hook that was no longer needed. --- src/pages/tutorial/section/Tutorials.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/tutorial/section/Tutorials.tsx b/src/pages/tutorial/section/Tutorials.tsx index 29cba10..a8cf2d1 100644 --- a/src/pages/tutorial/section/Tutorials.tsx +++ b/src/pages/tutorial/section/Tutorials.tsx @@ -16,12 +16,12 @@ const Tutorials = () => { }); const { id } = useSelector((state: RootState) => state.categoryIdState); - const [activeTutorial, setActiveTutorial] = useState(2); + const [activeTutorial, setActiveTutorial] = useState(8); useEffect(() => { if (id !== 0) setActiveTutorial(id); }, [id]); - useEffect(() => {}, []); + return (

آموزش