Skip to content

Commit

Permalink
Merge pull request #125 from ajinkyapandetekdi/all-2.0-offline
Browse files Browse the repository at this point in the history
Issueid #223945 fix: When user is loggin out we are redirecting to Di…
  • Loading branch information
gouravmore authored Aug 2, 2024
2 parents 4923e4e + 529ad8b commit 069dc61
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/Assesment/Assesment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ export const ProfileHeader = ({
const handleLogout = () => {
localStorage.clear();
end({});
navigate("/Login");
navigate("/login");
};

const CustomIconButton = styled(IconButton)({
Expand Down
25 changes: 12 additions & 13 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
import * as reviews from "../views";

const routData = [
{
id: "route-001",
path: "/",
component: reviews.DiscoverStart,
requiresAuth: true,
},
{
id: "route-002",
path: "/discover",
Expand Down Expand Up @@ -40,7 +46,6 @@ const routData = [
component: reviews.AssesmentEnd,
requiresAuth: true,
},

{
id: "route-008",
path: "/level-page",
Expand All @@ -53,6 +58,12 @@ const routData = [
component: reviews.PracticeRedirectPage,
requiresAuth: true,
},
{
id: "route-010",
path: "/login",
component: reviews.LoginPage,
requiresAuth: false,
},
];
// add login route for test rig

Expand All @@ -61,12 +72,6 @@ const isLogin = process.env.REACT_APP_IS_IN_APP_AUTHORISATION === "true";

if (isLogin && !virtualId) {
routData.push(
{
id: "route-001",
path: "/",
component: reviews.LoginPage,
requiresAuth: true,
},
{
id: "route-000",
path: "*",
Expand All @@ -76,12 +81,6 @@ if (isLogin && !virtualId) {
);
} else {
routData.push(
{
id: "route-001",
path: "/",
component: reviews.DiscoverStart,
requiresAuth: false,
},
{
id: "route-000",
path: "*",
Expand Down
2 changes: 2 additions & 0 deletions src/utils/VoiceAnalyser.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function VoiceAnalyser(props) {
if (callUpdateLearner) {
try {
let nonDenoisedRes = await getResponseText(nondenoisedBlob);
nonDenoisedRes = await filterBadWords(nonDenoisedRes);
setNonDenoisedText(nonDenoisedRes);
console.log("non denoised output -- ", nonDenoisedRes);
console.log(fuzz.ratio(props.originalText, nonDenoisedRes));
Expand Down Expand Up @@ -147,6 +148,7 @@ function VoiceAnalyser(props) {
if (callUpdateLearner) {
try {
let denoisedRes = await getResponseText(denoisedBlob);
denoisedRes = await filterBadWords(denoisedRes);
setDenoisedText(denoisedRes);
console.log("denoised output -- ", denoisedRes);
console.log(fuzz.ratio(props.originalText, denoisedRes));
Expand Down
1 change: 1 addition & 0 deletions src/utils/constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/views/AppContent/AppContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ const PrivateRoute = (props) => {
const navigate = useNavigate();
useEffect(() => {
if (!virtualId && props.requiresAuth) {
navigate("/");
navigate("/login");
}
}, [virtualId]);

return <>{props.children}</>;
};
const AppContent = ({ routes }) => {
// const navigate = useNavigate();
// const location = useLocation();

return (
<Fragment>
Expand Down

0 comments on commit 069dc61

Please sign in to comment.