mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
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:
parent
e4ee710404
commit
98f168e5c6
1 changed files with 16 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue