From 16fe39a322087ba829ce482284e3fdad86df66a0 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 13 Nov 2026 13:06:23 +0100 Subject: fix(music): drop the last cover when nothing is playing update() swapped in an when the state had art but never swapped it back, so with no player left the widget kept the last track's cover. Put the placeholder back when the state has no art. Co-Authored-By: Claude Opus 5.5 --- static/modules/music.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'static/modules') diff --git a/static/modules/music.js b/static/modules/music.js index 5ba3386..e127969 100644 --- a/static/modules/music.js +++ b/static/modules/music.js @@ -97,6 +97,14 @@ export default { el.querySelector(".art").replaceWith(img); } if (img.getAttribute("src") !== st.art) img.src = st.art; + } else { + const img = el.querySelector("img.art"); + if (img) { + const empty = document.createElement("div"); + empty.className = "art empty"; + empty.textContent = "♪"; + img.replaceWith(empty); + } } el.querySelector(".title").textContent = st.title || "Nothing playing"; el.querySelector(".artist").textContent = st.artist || ""; -- cgit v1.2.3