partial synch with ph2 updates
This commit is contained in:
+37
-29
@@ -20,7 +20,7 @@ import { wrapper } from "../store/store";
|
||||
import ServiceBanner from "../components/servicebanner";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages, showMap } = props;
|
||||
const { footerLinks, pages, showMap, showLoginCheck } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -105,6 +105,7 @@ const Home = (props) => {
|
||||
showMap={showMap}
|
||||
searchString="DNS"
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
showLoginCheck={showLoginCheck}
|
||||
/>
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
||||
@@ -123,40 +124,47 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
"public, s-maxage=10, stale-while-revalidate=59"
|
||||
);
|
||||
|
||||
let searchResultsObj = await getBasicDNSSearch();
|
||||
// let searchResultsObj = await getBasicDNSSearch();
|
||||
|
||||
searchResultsObj =
|
||||
searchResultsObj.status == 502
|
||||
? {
|
||||
value: [],
|
||||
errorCode: searchResultsObj.status,
|
||||
errorMsg: searchResultsObj.statusText,
|
||||
}
|
||||
: searchResultsObj;
|
||||
// searchResultsObj =
|
||||
// searchResultsObj.status == 502
|
||||
// ? {
|
||||
// value: [],
|
||||
// errorCode: searchResultsObj.status,
|
||||
// errorMsg: searchResultsObj.statusText,
|
||||
// }
|
||||
// : searchResultsObj;
|
||||
|
||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||
const showMapCheck = process.env.SHOWMAPS || false;
|
||||
|
||||
if (_.has(searchResultsObj, "status") == true) {
|
||||
return {
|
||||
redirect: {
|
||||
//destination: "/dns-not-found",
|
||||
destination: "/error",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
searchResultsObj
|
||||
);
|
||||
const dnsCoords = await getDNSCoords();
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch("DNS"));
|
||||
store.dispatch(setDNSCoords(dnsCoords));
|
||||
}
|
||||
// if (_.has(searchResultsObj, "status") == true) {
|
||||
// return {
|
||||
// redirect: {
|
||||
// //destination: "/dns-not-found",
|
||||
// destination: "/error",
|
||||
// permanent: false,
|
||||
// },
|
||||
// };
|
||||
// } else {
|
||||
// // const searchDetailsObj = await getSearchDetails(
|
||||
// // searchResultsObj
|
||||
// // );
|
||||
// const dnsCoords = await getDNSCoords();
|
||||
// // store.dispatch(setSearchResults(searchResultsObj));
|
||||
// // store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
// store.dispatch(setSearch("DNS"));
|
||||
// store.dispatch(setDNSCoords(dnsCoords));
|
||||
// }
|
||||
const dnsCoords = await getDNSCoords();
|
||||
store.dispatch(setSearch("DNS"));
|
||||
store.dispatch(setDNSCoords(dnsCoords));
|
||||
|
||||
return {
|
||||
props: { showMap: showMapCheck },
|
||||
props: {
|
||||
showMap: showMapCheck,
|
||||
showLoginCheck: showLoginCheck,
|
||||
},
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user