language check update
This commit is contained in:
+10
-9
@@ -272,6 +272,16 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
? "cy"
|
? "cy"
|
||||||
: "en";
|
: "en";
|
||||||
|
|
||||||
|
// added to redirect if not the users preferred language
|
||||||
|
if (preferredLocale != ctx.locale) {
|
||||||
|
return {
|
||||||
|
redirect: {
|
||||||
|
destination: `/${preferredLocale}`,
|
||||||
|
permanent: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||||
const showMapCheck = process.env.SHOWMAPS || false;
|
const showMapCheck = process.env.SHOWMAPS || false;
|
||||||
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
||||||
@@ -305,14 +315,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
const mySubmittedReps = showSubmittedReps(watchedCases);
|
const mySubmittedReps = showSubmittedReps(watchedCases);
|
||||||
|
|
||||||
// if (preferredLocale != ctx.locale) {
|
|
||||||
// return {
|
|
||||||
// redirect: {
|
|
||||||
// destination: "/cy/myportal",
|
|
||||||
// permanent: false,
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
// } else {
|
|
||||||
if (_.has(accountDetails, "errorCode") != false) {
|
if (_.has(accountDetails, "errorCode") != false) {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
@@ -369,7 +371,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user