diff --git a/public/app.js b/public/app.js index 20db01f..dbef214 100644 --- a/public/app.js +++ b/public/app.js @@ -302,6 +302,9 @@ function showDashboard() { sp.style.display = 'none'; sp.innerHTML = ''; document.getElementById('admin-controls').style.display = isAdmin ? 'flex' : 'none'; + // Show webhooks section for admin users + const webhooksSection = document.getElementById('webhooks-section'); + if (webhooksSection) webhooksSection.style.display = isAdmin ? '' : 'none'; // Initialise days input from saved value const daysInput = document.getElementById('history-days'); if (daysInput) daysInput.value = historyDays; @@ -1163,10 +1166,7 @@ function initWebhooks() { const webhooksSection = document.getElementById('webhooks-section'); if (!webhooksSection) return; - // Show webhooks section for admin users - if (isAdmin) { - webhooksSection.style.display = ''; - } + // Note: visibility is controlled by showDashboard() based on isAdmin document.getElementById('webhooks-header').addEventListener('click', toggleWebhookSection); document.getElementById('enable-sonarr-webhook').addEventListener('click', enableSonarrWebhook);