diff --git a/public/js/db.js b/public/js/db.js index 2f1ca2e24..632f61ae4 100644 --- a/public/js/db.js +++ b/public/js/db.js @@ -32,12 +32,12 @@ async function db_getUserResults() { return ret; } -async function db_getUserHighestWpm(mode, mode2) { +async function db_getUserHighestWpm(mode, mode2, punctuation, language) { function cont() { let topWpm = 0; dbSnapshot.forEach(result => { - if (result.mode == mode && result.mode2 == mode2) { + if (result.mode == mode && result.mode2 == mode2 && result.punctuation == punctuation && result.language == language) { if (result.wpm > topWpm) { topWpm = result.wpm; } diff --git a/public/js/script.js b/public/js/script.js index 6494d3509..8028874a5 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -463,7 +463,7 @@ function showResult() { restartCount = 0; if (stats.wpm > 0 && stats.wpm < 600 && stats.acc > 50 && stats.acc <= 100) { if (firebase.auth().currentUser != null) { - db_getUserHighestWpm(config.mode, mode2).then(data => { + db_getUserHighestWpm(config.mode, mode2, config.punctuation, config.language).then(data => { // console.log(`highest wpm for this mode is ${data}, current is ${stats.wpm}`); if (data < stats.wpm) { showCrown();