Skip to content

Commit 5fb21a9

Browse files
author
Bot
committed
fix NaN on results page
1 parent 20daae6 commit 5fb21a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/views/Results.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default {
114114
return this.stats.history;
115115
},
116116
mistakes() {
117-
return this.history.filter((change) => change.type === 'mistake');
117+
return this.history.filter((change) => change.type === 'mistake' || change.type === 'blockedEnter');
118118
},
119119
correctInputs() {
120120
return this.history.reduce((acc, event) => (event.type === 'correct' ? acc + 1 : acc), 0);
@@ -135,7 +135,7 @@ export default {
135135
return this.format(this.stats.correctLines / this.stats.codeInfo.lines, 1, 100);
136136
},
137137
mostMistakesInARow() {
138-
return this.mistakes.map((obj) => obj.fixQueuePos)
138+
return this.mistakes.map((obj) => obj.fixQueuePos || 1)
139139
.reduce((acc, value) => Math.max(acc, value), 0);
140140
},
141141
correctionTimes() {

0 commit comments

Comments
 (0)