We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cbfa1d commit c1fefffCopy full SHA for c1fefff
1 file changed
Sprint-3/quote-generator/quotes.js
@@ -513,10 +513,13 @@ let autoPlayInterval = null;
513
autoPlayToggle.addEventListener("click", () => {
514
if (autoPlayToggle.checked) {
515
autoPlayStatus.innerText = "auto-play: ON";
516
- autoPlayInterval = setInterval(showRandomQuote, 4000);
+ if (!autoPlayInterval) {
517
+ autoPlayInterval = setInterval(showRandomQuote, 4000);
518
+ }
519
} else {
520
autoPlayStatus.innerText = "auto-play: OFF";
521
clearInterval(autoPlayInterval);
522
+ autoPlayInterval = null;
523
}
524
});
525
0 commit comments