mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-03 04:19:06 +08:00
display 0 if the time typing is NaN. (#2571)
This commit is contained in:
parent
c71baadc9b
commit
cc5eca2740
1 changed files with 8 additions and 7 deletions
|
@ -14,13 +14,14 @@ export function update(): void {
|
|||
// let th = Math.floor(DB.getSnapshot().globalStats.time / 3600);
|
||||
// let tm = Math.floor((DB.getSnapshot().globalStats.time % 3600) / 60);
|
||||
// let ts = Math.floor((DB.getSnapshot().globalStats.time % 3600) % 60);
|
||||
$(".pageAccount .globalTimeTyping .val").text(
|
||||
Misc.secondsToString(
|
||||
Math.round(snapshot.globalStats.time as number),
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
const seconds = snapshot?.globalStats?.time ?? 0;
|
||||
let string = "";
|
||||
if (seconds === 0) {
|
||||
string = "-";
|
||||
} else {
|
||||
string = Misc.secondsToString(seconds, true, true);
|
||||
}
|
||||
$(".pageAccount .globalTimeTyping .val").text(string);
|
||||
}
|
||||
|
||||
if (snapshot.globalStats !== undefined) {
|
||||
|
|
Loading…
Reference in a new issue