mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-02 20:08:18 +08:00
added check for 0 wpm when sending to db
This commit is contained in:
parent
6409af7fc5
commit
078e0c3072
2 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@ const db = firebase.firestore();
|
|||
|
||||
function db_testCompleted(wpm, correctChars, incorrectChars, acc, mode, mode2, punctuation) {
|
||||
|
||||
if (wpm > 250 || acc < 50 || acc > 100) return false;
|
||||
if (wpm == 0 || wpm > 250 || acc < 50 || acc > 100) return false;
|
||||
|
||||
let uid = "";
|
||||
let user = firebase.auth().currentUser;
|
||||
|
|
|
@ -386,7 +386,7 @@ function showResult() {
|
|||
}
|
||||
$("#result .stats .wpm .top .crown").remove();
|
||||
|
||||
if (stats.wpm < 250 && stats.acc > 50 && stats.acc <= 100) {
|
||||
if (stats.wpm > 0 && stats.wpm < 250 && stats.acc > 50 && stats.acc <= 100) {
|
||||
db_getUserHighestWpm(config.mode, mode2).then(data => {
|
||||
if (data.wpm < stats.wpm || data == false) {
|
||||
$("#result .stats .wpm .top").append('<div class="crown"><i class="fas fa-crown"></i></div>');
|
||||
|
|
Loading…
Reference in a new issue