mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-11 06:05:16 +08:00
saving best pb for each mode
This commit is contained in:
parent
51f828a30a
commit
d7b9bf51fb
1 changed files with 11 additions and 0 deletions
|
@ -96,6 +96,17 @@ module.exports = {
|
|||
});
|
||||
}
|
||||
|
||||
let topIndex = 0;
|
||||
let topWpm = 0;
|
||||
obj[mode][mode2].forEach((pb, index) => {
|
||||
delete pb.best;
|
||||
if (pb.wpm > topWpm) {
|
||||
topIndex = index;
|
||||
topWpm = pb.wpm;
|
||||
}
|
||||
});
|
||||
obj[mode][mode2][topIndex].best = true;
|
||||
|
||||
return {
|
||||
isPb,
|
||||
obj,
|
||||
|
|
Loading…
Reference in a new issue