diff --git a/src/ui/Layout.js b/src/ui/Layout.js index d7f84747b..b238ec9cc 100644 --- a/src/ui/Layout.js +++ b/src/ui/Layout.js @@ -1,7 +1,7 @@ import React, { Suspense, useEffect, useState } from "react"; import { useSelector } from "react-redux"; -import { useNavigate } from "react-router-dom"; +import { useLocation, useNavigate } from "react-router-dom"; // import { useHistory } from "react-router-dom"; import { ThemeProvider, } from "@mui/material"; // import Header from "./components/common/Header"; @@ -26,6 +26,7 @@ const Layout= (props) => { const [show, setShow] = useState(false); const [popUp, setPopup] = useState(true); const apiStatus = useSelector((state) => state.apiStatus); + const location = useLocation(); const classes = GlobalStyles(); // const history = useHistory(); @@ -92,7 +93,7 @@ const Layout= (props) => { return (
Loading....
}>
{ />
{/* {renderSpinner()} {renderError()} */} diff --git a/src/ui/pages/component/Project/SuperCheckerTasks.jsx b/src/ui/pages/component/Project/SuperCheckerTasks.jsx index 805f45cae..371e565bf 100644 --- a/src/ui/pages/component/Project/SuperCheckerTasks.jsx +++ b/src/ui/pages/component/Project/SuperCheckerTasks.jsx @@ -199,15 +199,6 @@ const SuperCheckerTasks = (props) => { } }, [NextTask]); - useEffect(() => { - if (location.pathname === `projects/${id}/task/${NextTask?.id}`) { - localStorage.setItem("enableChitrlekhaUI", true); - } else { - localStorage.setItem("enableChitrlekhaUI", false); - } - localStorage.setItem("SuperCheckerStage", props.type); - },[]); - useEffect(() => { dispatch(SetTaskFilter(id, selectedFilters, props.type)); if (currentPageNumber !== 1) { @@ -277,7 +268,7 @@ const SuperCheckerTasks = (props) => { } else { setTasks([]); } - }, [taskList]); + }, [taskList, userDetails?.prefer_cl_ui]); useEffect(() => { const newCols = columns.map((col) => { diff --git a/src/ui/pages/component/Project/TaskTable.jsx b/src/ui/pages/component/Project/TaskTable.jsx index eb2586fef..9c28ee0e0 100644 --- a/src/ui/pages/component/Project/TaskTable.jsx +++ b/src/ui/pages/component/Project/TaskTable.jsx @@ -488,7 +488,7 @@ const TaskTable = (props) => { } else { setTasks([]); } - }, [taskList, ProjectDetails.project_mode]); + }, [taskList, ProjectDetails.project_mode, userDetails?.prefer_cl_ui]); useEffect(() => { const newCols = columns.map((col) => { diff --git a/src/ui/pages/component/common/Header.jsx b/src/ui/pages/component/common/Header.jsx index 28b4d18c2..f82521298 100644 --- a/src/ui/pages/component/common/Header.jsx +++ b/src/ui/pages/component/common/Header.jsx @@ -21,7 +21,7 @@ import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined"; import { useDispatch, useSelector } from "react-redux"; import APITransport from "../../../../redux/actions/apitransport/apitransport"; import FetchLoggedInUserDataAPI from "../../../../redux/actions/api/UserManagement/FetchLoggedInUserData"; -import { useNavigate } from "react-router-dom"; +import { useLocation, useNavigate } from "react-router-dom"; import CustomButton from "../common/Button"; import MobileNavbar from "./MobileNavbar"; import { useTheme } from "@emotion/react"; @@ -58,6 +58,7 @@ const Header = () => { const dispatch = useDispatch(); let navigate = useNavigate(); + const location = useLocation(); const classes = headerStyle(); @@ -658,10 +659,7 @@ const Header = () => { return ( diff --git a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx index 65b1bdc5b..969102faa 100644 --- a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx @@ -437,7 +437,6 @@ const AudioTranscriptionLandingPage = () => { getAnnotationsTaskData(taskId); getProjectDetails(); getTaskData(taskId); - localStorage.setItem("enableChitrlekhaUI", true); }, []); const getProjectDetails = () => { diff --git a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx index 97ac1a1b5..d24b4ba9b 100644 --- a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx @@ -478,7 +478,6 @@ const ReviewAudioTranscriptionLandingPage = () => { getAnnotationsTaskData(taskId); getProjectDetails(); getTaskData(taskId); - localStorage.setItem("enableChitrlekhaUI", true); console.log( localStorage.getItem("Stage") === "review", "StageStageStageStage" diff --git a/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx index 1601f924f..69a8d5584 100644 --- a/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx @@ -387,7 +387,6 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { getAnnotationsTaskData(taskId); getProjectDetails(); getTaskData(taskId); - localStorage.setItem("enableChitrlekhaUI", true); console.log( localStorage.getItem("Stage") === "review", "StageStageStageStage"