Removes usage of nullish coalescing operator

This commit is contained in:
Alicia Sykes 2022-05-19 13:19:13 +01:00
parent 7e547e7463
commit 00b872e671
3 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ const HomeMixin = {
return this.$store.state.modalOpen;
},
pageId() {
return this.subPageInfo?.pageId ? this.subPageInfo.pageId : 'home';
return (this.subPageInfo && this.subPageInfo.pageId) ? this.subPageInfo.pageId : 'home';
},
},
data: () => ({

View File

@ -50,7 +50,7 @@ const getStartingComponent = () => {
/* Returns the meta tags for each route */
const makeMetaTags = (defaultTitle) => ({
title: pageInfo?.title || defaultTitle,
title: pageInfo && pageInfo.title ? pageInfo.title : defaultTitle,
metaTags: metaTagData,
});

View File

@ -60,7 +60,7 @@ export default class ConfigAccumulator {
try { localPageInfo = JSON.parse(localStorage[localStorageKeys.PAGE_INFO]); }
catch (e) { ErrorHandler('Malformed pageInfo data in local storage'); }
}
const filePageInfo = this.conf?.pageInfo || {};
const filePageInfo = (this.conf && this.conf.pageInfo) ? this.conf.pageInfo : {};
return { ...defaultPageInfo, ...filePageInfo, ...localPageInfo };
}