Skip to content

Commit

Permalink
Issue feat:Fix language selected issue upon change academic year
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshataKatwal16 committed Dec 3, 2024
1 parent dc6c644 commit 4c01e57
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
16 changes: 15 additions & 1 deletion src/components/layouts/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,21 @@ const Header = ({ sx, customClass, toggleMobileSidebar, position }: any) => {
const storedUserData = JSON.parse(
localStorage.getItem("adminInfo") || "{}"
);
window.location.href = (storedUserData?.role === Role.SCTA || storedUserData?.role === Role.CCTA)?"/course-planner":"/centers";
// window.location.href = (storedUserData?.role === Role.SCTA || storedUserData?.role === Role.CCTA)?"/course-planner":"/centers";
const { locale } = router;
if(storedUserData?.role === Role.SCTA || storedUserData?.role === Role.CCTA)
{
if(locale)
router.push("/course-planner", undefined, { locale: locale });
else
router.push("/course-planner");
}
else{
if(locale)
router.push("/centers", undefined, { locale: locale });
else
router.push("/centers");
}
};

const handleChange = (event: SelectChangeEvent) => {
Expand Down
15 changes: 12 additions & 3 deletions src/pages/edit-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,21 @@ const EditForgotPassword = () => {
const storedUserData = JSON.parse(
localStorage.getItem("adminInfo") || "{}"
);
const { locale } = router;

if(storedUserData?.role === Role.SCTA || storedUserData?.role === Role.CCTA)
{
router.push(`/course-planner`);

if(locale)
router.push("/course-planner", undefined, { locale: locale });
else
router.push("/course-planner");
}else
router.push(`/centers`);
{
if(locale)
router.push("/centers", undefined, { locale: locale });
else
router.push("/centers");
}
localStorage.setItem('skipResetPassword', 'true');
};

Expand Down

0 comments on commit 4c01e57

Please sign in to comment.