Skip to content

Commit

Permalink
fix: handle missing dojo config correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Apr 5, 2023
1 parent 1ea0467 commit 11a81c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _src/app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions _src/app/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
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) {
has.add('web-workers', function () {
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');
}
Expand Down

0 comments on commit 11a81c2

Please sign in to comment.