From 11a81c2df0b7ab0a0b1de3134fe94790f395a17b Mon Sep 17 00:00:00 2001 From: stdavis Date: Tue, 28 Mar 2023 15:05:50 -0600 Subject: [PATCH] fix: handle missing dojo config correctly --- _src/app/config.js | 2 +- _src/app/run.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/_src/app/config.js b/_src/app/config.js index 3a8618c..f929a04 100644 --- a/_src/app/config.js +++ b/_src/app/config.js @@ -24,7 +24,7 @@ define([ let dataEntryApp = 'https://electrofishing.ugrc.utah.gov'; let baseUrl; - const projectId = window?.dojoConfig.isJasmineTestRunner ? 'test' : + const projectId = window.dojoConfig?.isJasmineTestRunner ? 'test' : JSON.parse(process.env.FIREBASE_CONFIG).projectId; if (has('agrc-build') === 'prod') { // *.ugrc.utah.gov diff --git a/_src/app/run.js b/_src/app/run.js index 444218e..ed955bd 100644 --- a/_src/app/run.js +++ b/_src/app/run.js @@ -6,8 +6,7 @@ var config = { baseUrl: ( typeof window !== 'undefined' && - window.dojoConfig && - window.dojoConfig.isJasmineTestRunner + window.dojoConfig?.isJasmineTestRunner ) ? '/src' : './' }; require(config, ['dojo/has', 'dojo/parser', 'jquery', 'dojo/domReady!'], function (has, parser) { @@ -15,7 +14,7 @@ return window.Worker; }); - if (!window?.dojoConfig.isJasmineTestRunner) { + if (!window.dojoConfig?.isJasmineTestRunner) { window.firebase.initializeApp(JSON.parse(process.env.FIREBASE_CONFIG)); console.log('firebase app initialized'); }