diff --git a/frontend/src/scripts/account/all-time-stats.ts b/frontend/src/scripts/account/all-time-stats.ts index cce9700c1..bf0594abf 100644 --- a/frontend/src/scripts/account/all-time-stats.ts +++ b/frontend/src/scripts/account/all-time-stats.ts @@ -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) {