From 3fc397a6f68a04a3b9b2364b9246ed01a322cc5f Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 25 Jul 2020 00:39:28 +0100 Subject: [PATCH] making sure you cant switch out of or to the challenge themes during or after the test --- public/js/userconfig.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/public/js/userconfig.js b/public/js/userconfig.js index a0cb64ec6..3b59315ff 100644 --- a/public/js/userconfig.js +++ b/public/js/userconfig.js @@ -532,10 +532,25 @@ function setMaxConfidence(mc, nosave) { } function previewTheme(name) { + if ( + (testActive || resultVisible) && + (config.theme === "nausea" || config.theme === "round_round_baby") + ) + return; + if (resultVisible && (name === "nausea" || name === "round_round_baby")) + return; $("#currentTheme").attr("href", `themes/${name}.css`); } function setTheme(name, nosave) { + if ( + (testActive || resultVisible) && + (config.theme === "nausea" || config.theme === "round_round_baby") + ) { + return; + } + if (resultVisible && (name === "nausea" || name === "round_round_baby")) + return; config.theme = name; $("#currentTheme").attr("href", `themes/${name}.css`); setTimeout(() => {