From f4b4df247c286d71f93c8de62c9104489abc5107 Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Wed, 11 Oct 2023 09:14:55 -0600 Subject: [PATCH] check if opcode.autogen is defined 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 --- frontend/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 49662dd..4eb9bda 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -812,12 +812,14 @@

Contact

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 {