mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 04:51:16 +08:00
the results now consider punctuation and language when checking if a crown should be showed
This commit is contained in:
parent
18eff0cc31
commit
65d30add8d
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue