From d6d31606ce4c44f1ad11075e62e0bb0982e025c9 Mon Sep 17 00:00:00 2001 From: Broque Thomas Date: Sun, 24 Aug 2025 17:31:20 -0700 Subject: [PATCH] Update script.js --- webui/static/script.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webui/static/script.js b/webui/static/script.js index 426760e2..e28746d7 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -3556,6 +3556,7 @@ function updateDbProgressUI(state) { // =============================== function initializeSyncPage() { + // Logic for tab switching const tabButtons = document.querySelectorAll('.sync-tab-button'); tabButtons.forEach(button => { button.addEventListener('click', () => { @@ -3572,6 +3573,14 @@ function initializeSyncPage() { document.getElementById(`${tabId}-tab-content`).classList.add('active'); }); }); + + // Logic for the Spotify refresh button + const refreshBtn = document.getElementById('spotify-refresh-btn'); + if (refreshBtn) { + // Remove any old listeners to be safe, then add the new one + refreshBtn.removeEventListener('click', loadSpotifyPlaylists); + refreshBtn.addEventListener('click', loadSpotifyPlaylists); + } }