mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 15:56:24 +08:00
fixed filtered time
This commit is contained in:
parent
c99773e700
commit
5bf4b22a87
|
@ -808,17 +808,19 @@ function refreshAccountPage() {
|
|||
//=======================================
|
||||
|
||||
tt = 0;
|
||||
if (result.timeDuration == null) {
|
||||
//test finished before timeduration field was introduced - estimate
|
||||
if (result.testDuration == undefined) {
|
||||
//test finished before testDuration field was introduced - estimate
|
||||
if (result.mode == "time") {
|
||||
tt = parseFloat(result.mode2);
|
||||
} else if (result.mode == "words") {
|
||||
tt = (parseFloat(result.mode2) / parseFloat(result.wpm)) * 60;
|
||||
}
|
||||
} else {
|
||||
tt = parseFloat(result.timeDuration);
|
||||
tt = parseFloat(result.testDuration);
|
||||
}
|
||||
if (result.restartCount != null) {
|
||||
if (result.incompleteTestSeconds != undefined) {
|
||||
tt += result.incompleteTestSeconds;
|
||||
} else if (result.restartCount != undefined && result.restartCount > 0) {
|
||||
tt += (tt / 4) * result.restartCount;
|
||||
}
|
||||
totalSecondsFiltered += tt;
|
||||
|
|
Loading…
Reference in a new issue