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.
This commit is contained in:
@@ -16,12 +16,12 @@ const Tutorials = () => {
|
||||
});
|
||||
const { id } = useSelector((state: RootState) => state.categoryIdState);
|
||||
|
||||
const [activeTutorial, setActiveTutorial] = useState<number>(2);
|
||||
const [activeTutorial, setActiveTutorial] = useState<number>(8);
|
||||
|
||||
useEffect(() => {
|
||||
if (id !== 0) setActiveTutorial(id);
|
||||
}, [id]);
|
||||
useEffect(() => {}, []);
|
||||
|
||||
return (
|
||||
<div className="relative w-full h-full flex flex-col px-4 py-4 text-start">
|
||||
<h1 className="font-bold text-xl md:text-2xl text-center">آموزش</h1>
|
||||
|
||||
Reference in New Issue
Block a user