From e23badbee62992ebd472529a6eb3856624a8b06c Mon Sep 17 00:00:00 2001 From: stdavis Date: Tue, 28 Mar 2023 13:58:25 -0600 Subject: [PATCH] fix: handle missing dojoConfig in deployed app --- _src/app/config.js | 2 +- _src/app/run.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_src/app/config.js b/_src/app/config.js index 7afc0f7..3a8618c 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 7aaa5e0..444218e 100644 --- a/_src/app/run.js +++ b/_src/app/run.js @@ -15,7 +15,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'); }