fixed an issue where people without the difficulty or blind mode being set would not have results saved

This commit is contained in:
Jack 2020-05-31 21:14:47 +01:00
parent 6c7d8e44d6
commit 656af17815

View file

@ -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;