added a check to stop the website from freezing

This commit is contained in:
Jack 2021-09-15 15:24:42 +01:00
parent 7df64007fe
commit 2025beb4da

View file

@ -52,6 +52,11 @@ export function init(missed, slow) {
// console.log(sortableMissedWords);
// console.log(sortableSlowWords);
if (sortableMissedWords.length == 0 && sortableSlowWords.length == 0) {
Notifications.add("Could not start a new custom test", 0);
return;
}
let newCustomText = [];
sortableMissedWords.forEach((missed, index) => {
for (let i = 0; i < missed[1]; i++) {