Fixed endless error

Handled the error if user input is undefined or just an empty string (which causes an endless error)
pull/63/head
Keshav2567 3 years ago committed by GitHub
parent 0cb9fd377d
commit 4191c02d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,12 +33,14 @@ function randomSelect() {
const interval = setInterval(() => {
const randomTag = pickRandomTag()
if (randomTag !== undefined) {
highlightTag(randomTag)
setTimeout(() => {
unHighlightTag(randomTag)
}, 100)
}
}, 100);
setTimeout(() => {
@ -64,4 +66,4 @@ function highlightTag(tag) {
function unHighlightTag(tag) {
tag.classList.remove('highlight')
}
}

Loading…
Cancel
Save