Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:zap: Removes usage of nullish coalescing operator

Alicia Sykes00b872e67198
diff --git a/src/mixins/HomeMixin.js b/src/mixins/HomeMixin.js
index 74bf984a..545f3631 100644
--- a/src/mixins/HomeMixin.js
+++ b/src/mixins/HomeMixin.js
@@ -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: () => ({
diff --git a/src/router.js b/src/router.js
index bf520682..7551c9d3 100644
--- a/src/router.js
+++ b/src/router.js
@@ -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,
});
diff --git a/src/utils/ConfigAccumalator.js b/src/utils/ConfigAccumalator.js
index 3e0ab772..3c07c238 100644
--- a/src/utils/ConfigAccumalator.js
+++ b/src/utils/ConfigAccumalator.js
@@ -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 };
}