Check if element has two children before highlighting

This commit is contained in:
Mars Niermann 2023-03-08 10:15:01 +00:00
parent 80aa3d0f4b
commit b7c8d7821d

View file

@ -151,9 +151,11 @@
for (let i = 0; i < collection.length; i++) {
let curr = collection[i];
if (curr.firstChild.firstChild !== null) {
if (curr.firstChild.firstChild.classList.contains("audiotrack")) {
curr.style.backgroundColor = "rgba(251, 73, 52, 0.7)"
}
}
// Append buttons to list
curr.appendChild(refreshButton());