Fixed endless error
Handled the error if user input is undefined or just an empty string (which causes an endless error)
This commit is contained in:
parent
0cb9fd377d
commit
4191c02d62
@ -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…
Reference in New Issue
Block a user