fix: improve now playing error handling

This commit is contained in:
Cory Dransfeldt 2024-02-22 09:06:44 -08:00
parent 157b1c7b67
commit 8d41e1c5b3
No known key found for this signature in database
3 changed files with 50 additions and 23 deletions

View file

@ -24,10 +24,17 @@ class NowPlaying extends HTMLElement {
const content = this.querySelector('[data-key="content"]')
const value = data['content']
loading.style.opacity = '0'
loading.style.display = 'none'
content.style.opacity = '1'
content.innerHTML = value
if (!value) {
loading.style.display = 'none'
content.style.display = 'none'
}
if (value) {
loading.style.opacity = '0'
loading.style.display = 'none'
content.style.opacity = '1'
content.innerHTML = value
}
}
get template() {