From 2230e6d9009ba4d38879cb5821f55a45165b6386 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 26 Jan 2022 15:08:13 +0100 Subject: [PATCH] using actual words length instead of the loop variable --- src/js/test/test-logic.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index 41f03e6f6..ecbba0697 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -868,14 +868,14 @@ export async function init() { } else { for (let i = 0; i < wordsBound; i++) { let randomWord = wordset.randomWord(); - const previousWord = words.get(i - 1, true); - const previousWord2 = words.get(i - 2, true); + const previousWord = words.get(words.length - 1, true); + const previousWord2 = words.get(words.length - 2, true); if ( Config.mode == "custom" && !CustomText.isWordRandom && !CustomText.isTimeRandom ) { - randomWord = CustomText.text[i]; + randomWord = CustomText.text[words.length]; } else if ( Config.mode == "custom" && (wordset.length < 3 || PractiseWords.before.mode !== null) @@ -933,9 +933,9 @@ export async function init() { if (Config.punctuation) { randomWord = punctuateWord( - words.get(i - 1), + words.get(words.length - 1), randomWord, - i, + words.length, wordsBound ); }