feat: zmiana ikony play/pause w dashboardzie zależnie od stanu odtwarzania

This commit is contained in:
mmacierzanka committed 2026-07-04 16:38:12 +02:00
1 parent 55c9b7207f
commit 2a399364d8
1 file changed
+8 -6
+8 -6
View File
@@ -358,12 +358,14 @@ function updateUI(status) {
}
// 3. Play/Pause Button State
if (status.playing) {
playPauseIcon.setAttribute('data-lucide', 'pause');
btnPlayPause.title = "Wstrzymaj";
} else {
playPauseIcon.setAttribute('data-lucide', 'play');
btnPlayPause.title = "Odtwarzaj";
const targetIcon = status.playing ? 'pause' : 'play';
if (btnPlayPause.dataset.state !== targetIcon) {
btnPlayPause.dataset.state = targetIcon;
btnPlayPause.innerHTML = `<i data-lucide="${targetIcon}"></i>`;
btnPlayPause.title = status.playing ? "Wstrzymaj" : "Odtwarzaj";
if (window.lucide) {
lucide.createIcons();
}
}
// 4. Volume State