From ee7cd8ef6f512ee90e382f8472e43acdb56b4b58 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Mon, 16 Mar 2026 07:56:09 +0100 Subject: [PATCH] fix(lyrion): Fix Rescan button disabled state in updateUI The updateUI function was incorrectly disabling the Rescan button when Lyrion was running. Rescan should only be enabled when running. - Split forEach into separate button handlers - Start button: disabled when running (correct) - Rescan button: disabled when NOT running (fixed) Co-Authored-By: Claude Opus 4.5 --- .../htdocs/luci-static/resources/view/lyrion/overview.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/secubox/luci-app-lyrion/htdocs/luci-static/resources/view/lyrion/overview.js b/package/secubox/luci-app-lyrion/htdocs/luci-static/resources/view/lyrion/overview.js index a84a50f5..67a8c8b6 100644 --- a/package/secubox/luci-app-lyrion/htdocs/luci-static/resources/view/lyrion/overview.js +++ b/package/secubox/luci-app-lyrion/htdocs/luci-static/resources/view/lyrion/overview.js @@ -38,10 +38,10 @@ return view.extend({ stats.textContent = s.songs + ' songs, ' + s.albums + ' albums, ' + s.artists + ' artists'; } - ['btn-start', 'btn-rescan'].forEach(function(id) { - var el = document.getElementById(id); - if (el) el.disabled = s.running; - }); + var startBtn = document.getElementById('btn-start'); + if (startBtn) startBtn.disabled = s.running; + var rescanBtn = document.getElementById('btn-rescan'); + if (rescanBtn) rescanBtn.disabled = !s.running; var stopBtn = document.getElementById('btn-stop'); if (stopBtn) stopBtn.disabled = !s.running; },