Skip to content

Commit

Permalink
check if opcode.autogen is defined
Browse files Browse the repository at this point in the history
prior to this change, was testing if it was true, which was not desired behavior

Tested by:
- watching page behavior for config with opcode true
- config with opcode false
- config with no opcode program
- config with no opcode study

All four combinations had expected log statements and opcode behavior
  • Loading branch information
Abby Wheelis committed Oct 11, 2023
1 parent bb4d903 commit f4b4df2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -812,12 +812,14 @@ <h2 data-i18n="contact">Contact</h2>
console.log("Dynamic Config result is", data);

//create token and token url
if(data.opcode?.autogen) { //if the autogen property is set, use it
if(typeof data.opcode?.autogen !== 'undefined') { //if the autogen property is set, use it
console.log("found opcode setting, is", data.opcode.autogen);
OPCODE_AUTOGEN = data.opcode?.autogen;
} else { //else fall back to program vs study
console.log("falling back to program vs study", data.intro.program_or_study);
OPCODE_AUTOGEN = data.intro.program_or_study == "study";
}

if (OPCODE_AUTOGEN) {
validateAndGenerateToken();
} else {
Expand Down

0 comments on commit f4b4df2

Please sign in to comment.