From 656af1781546bb9005d045d9987b5c2b0c9aa31f Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 31 May 2020 21:14:47 +0100 Subject: [PATCH] fixed an issue where people without the difficulty or blind mode being set would not have results saved --- public/js/userconfig.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/js/userconfig.js b/public/js/userconfig.js index f3705eddd..17f508f26 100644 --- a/public/js/userconfig.js +++ b/public/js/userconfig.js @@ -56,6 +56,14 @@ function loadConfigFromCookie() { } config = newConfig; } + if(config.difficulty == undefined){ + config.difficulty = "normal"; + saveConfigToCookie(); + } + if(config.blindMode == undefined){ + config.blindMode = false; + saveConfigToCookie(); + } } function showTestConfig() { @@ -68,7 +76,7 @@ function hideTestConfig() { //difficulty function setDifficulty(diff, nosave){ - if(diff !== "normal" && diff !== "expert" && diff !== "master"){ + if((diff !== "normal" && diff !== "expert" && diff !== "master") || diff == undefined){ diff = "normal"; } config.difficulty = diff;