From 8c50f0f74f465734f661b139078326f5995a40ec Mon Sep 17 00:00:00 2001 From: Arif-tekdi-technologies Date: Tue, 26 Nov 2024 17:44:30 +0530 Subject: [PATCH] Issue #0000 feat: Course planner bug fixes --- src/pages/subjectDetails.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/pages/subjectDetails.tsx b/src/pages/subjectDetails.tsx index 1f856bf2..d0d734de 100644 --- a/src/pages/subjectDetails.tsx +++ b/src/pages/subjectDetails.tsx @@ -85,6 +85,15 @@ const SubjectDetails = () => { const setTaxonomyType = taxonomyStore((state) => state.setTaxonomyType); const setTaxonomySubject = taxonomyStore((state) => state.setTaxonomySubject); + useEffect(() => { + const savedMedium = localStorage.getItem("selectedMedium") || ""; + const savedGrade = localStorage.getItem("selectedGrade") || ""; + const savedType = localStorage.getItem("selectedType") || ""; + setSelectedmedium(savedMedium); + setSelectedgrade(savedGrade); + // setSelectedtype(savedType); + }, []); + useEffect(() => { const subjects = localStorage.getItem("overallCommonSubjects"); @@ -164,16 +173,6 @@ const SubjectDetails = () => { fetchFrameworkDetails(); }, [boardName]); - useEffect(() => { - const savedMedium = localStorage.getItem("selectedMedium") || ""; - const savedGrade = localStorage.getItem("selectedGrade") || ""; - const savedType = localStorage.getItem("selectedType") || ""; - - setSelectedmedium(savedMedium); - setSelectedgrade(savedGrade); - setSelectedtype(savedType); - }, []); - const fetchAndSetGradeData = (medium: any) => { const getGrades = getOptionsByCategory(store?.framedata, "gradeLevel"); const mediumAssociations = getAssociationsByCodeNew(mediumOptions, medium);