when custom text random is enabled, making sure to dynamically add more words

made sure progress words for custom texts
This commit is contained in:
Jack 2020-07-27 03:06:02 +01:00
parent e4ee710404
commit 98f168e5c6

View file

@ -310,15 +310,19 @@ function initWords() {
) {
// let wordsBound = config.mode == "time" ? 60 : config.words;
let wordsBound = 60;
if (config.showAllLines && config.mode != "time") {
wordsBound = config.words;
if (config.showAllLines) {
if (config.mode === "custom") {
wordsBound = customTextWordCount;
} else if (config.mode != "time") {
wordsBound = config.words;
}
} else {
if (config.mode === "words" && config.words < wordsBound) {
wordsBound = config.words;
}
}
if (config.mode == "custom") {
wordsBound = customTextWordCount;
if (config.mode == "custom" && customTextWordCount < wordsBound) {
wordsBound = customTextWordCount;
}
}
let wordset = language;
if (config.mode == "custom") {
@ -796,6 +800,13 @@ function updateTimer() {
if (config.mode === "words") {
outof = config.words;
}
if (config.mode === "custom") {
if (customTextIsRandom) {
outof = customTextWordCount;
} else {
outof = customText.length;
}
}
$("#timerNumber").html(`${inputHistory.length}/${outof}`);
// $("#timerNumber").html(config.time - time);
}