mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-26 15:54:35 +08:00
chore: checking if key data is longer than 0
This commit is contained in:
parent
67940204a1
commit
2dfd7c2a04
1 changed files with 8 additions and 2 deletions
|
@ -245,7 +245,10 @@ export async function addResult(
|
|||
throw new MonkeyError(400, "Impossible funbox combination");
|
||||
}
|
||||
|
||||
if (completedEvent.keySpacing !== "toolong") {
|
||||
if (
|
||||
completedEvent.keySpacing !== "toolong" &&
|
||||
completedEvent.keySpacing.length > 0
|
||||
) {
|
||||
completedEvent.keySpacingStats = {
|
||||
average:
|
||||
completedEvent.keySpacing.reduce(
|
||||
|
@ -255,7 +258,10 @@ export async function addResult(
|
|||
};
|
||||
}
|
||||
|
||||
if (completedEvent.keyDuration !== "toolong") {
|
||||
if (
|
||||
completedEvent.keyDuration !== "toolong" &&
|
||||
completedEvent.keyDuration.length > 0
|
||||
) {
|
||||
completedEvent.keyDurationStats = {
|
||||
average:
|
||||
completedEvent.keyDuration.reduce(
|
||||
|
|
Loading…
Reference in a new issue