fix: improve now playing error handling
This commit is contained in:
parent
157b1c7b67
commit
8d41e1c5b3
3 changed files with 50 additions and 23 deletions
|
@ -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() {
|
||||
|
|
Reference in a new issue