mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-02 12:00:10 +08:00
added a try catch to avoid errors
This commit is contained in:
parent
71dd8c105e
commit
d29b0334e6
1 changed files with 12 additions and 10 deletions
|
@ -4077,18 +4077,20 @@ let wpmOverTimeChart = new Chart(ctx, {
|
|||
intersect: false,
|
||||
callbacks: {
|
||||
afterLabel: function (ti, data) {
|
||||
$(".wordInputAfter").remove();
|
||||
try {
|
||||
$(".wordInputAfter").remove();
|
||||
|
||||
let wordsToHighlight =
|
||||
keypressPerSecond[parseInt(ti.xLabel) - 1].words;
|
||||
let wordsToHighlight =
|
||||
keypressPerSecond[parseInt(ti.xLabel) - 1].words;
|
||||
|
||||
let unique = [...new Set(wordsToHighlight)];
|
||||
unique.forEach((wordIndex) => {
|
||||
let wordEl = $($("#words .word")[wordIndex]);
|
||||
let input = wordEl.attr("input");
|
||||
if (input != undefined)
|
||||
wordEl.append(`<div class="wordInputAfter">${input}</div>`);
|
||||
});
|
||||
let unique = [...new Set(wordsToHighlight)];
|
||||
unique.forEach((wordIndex) => {
|
||||
let wordEl = $($("#words .word")[wordIndex]);
|
||||
let input = wordEl.attr("input");
|
||||
if (input != undefined)
|
||||
wordEl.append(`<div class="wordInputAfter">${input}</div>`);
|
||||
});
|
||||
} catch (e) {}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue