mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-01 11:48:04 +08:00
removed the posibility of duplicate quotes
This commit is contained in:
parent
d6f7da7c09
commit
8c45b2d48d
1 changed files with 6 additions and 2 deletions
|
|
@ -529,8 +529,12 @@ function initWords() {
|
|||
group = Math.floor(Math.random() * quotes.groups.length);
|
||||
}
|
||||
|
||||
randomQuote = quotes.groups[group][Math.floor(Math.random() * quotes.groups[group].length)];
|
||||
let w = randomQuote.text.trim().split(" ");
|
||||
rq = quotes.groups[group][Math.floor(Math.random() * quotes.groups[group].length)];
|
||||
if (randomQuote != null && rq.id === randomQuote.id) {
|
||||
rq = quotes.groups[group][Math.floor(Math.random() * quotes.groups[group].length)];
|
||||
}
|
||||
randomQuote = rq;
|
||||
let w = rq.text.trim().split(" ");
|
||||
for (let i = 0; i < w.length; i++) {
|
||||
wordsList.push(w[i]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue