From 2d044022847a532b3e20e6fd4c6b0ce177f82bb5 Mon Sep 17 00:00:00 2001 From: Gronod Date: Tue, 19 May 2026 20:36:33 +0100 Subject: [PATCH] fix(webhooks): Show webhooks panel only to admin users --- public/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);