fixed bar progress for custom

This commit is contained in:
Jack 2020-07-27 03:09:05 +01:00
parent 98f168e5c6
commit fb5e748ac6

View file

@ -784,9 +784,18 @@ function updateTimer() {
config.mode === "quote"
) {
if (config.timerStyle === "bar") {
let percent = Math.floor(
((currentWordIndex + 1) / wordsList.length) * 100
);
let outof = wordsList.length;
if (config.mode === "words") {
outof = config.words;
}
if (config.mode === "custom") {
if (customTextIsRandom) {
outof = customTextWordCount;
} else {
outof = customText.length;
}
}
let percent = Math.floor(((currentWordIndex + 1) / outof) * 100);
$("#timer")
.stop(true, true)
.animate(