Support icon-less entries

This commit is contained in:
Hans5958 2022-05-11 13:09:17 +07:00
parent 55ce2de545
commit bd030f8cfb

View file

@ -134,8 +134,16 @@ async function updateBackground(newPeriod = currentPeriod, newVariation = curren
const variationConfig = variationsConfig[newVariation]
variantsEl.value = currentVariation
variantsEl.previousElementSibling.innerHTML = variationConfig.icon
if (variationConfig.icon) {
variantsEl.previousElementSibling.innerHTML = variationConfig.icon
variantsEl.previousElementSibling.classList.remove('d-none')
variantsEl.parentElement.classList.add('input-group')
} else {
variantsEl.previousElementSibling.innerHTML = ""
variantsEl.previousElementSibling.classList.add('d-none')
variantsEl.parentElement.classList.remove('input-group')
}
const configObject = variationConfig.versions[currentPeriod]
if (typeof configObject.url === "string") {
if (imageCache[configObject.url] === undefined) {