From da6489debbeac302d6154174435090b3e0b8c72f Mon Sep 17 00:00:00 2001 From: HighImKevin Date: Thu, 5 Feb 2026 19:34:05 -0500 Subject: [PATCH] Fix issue with headerTabs preventing native home screen tabs from loading --- scripts/headerTabs.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/headerTabs.js b/scripts/headerTabs.js index 4eb0587..e04c363 100644 --- a/scripts/headerTabs.js +++ b/scripts/headerTabs.js @@ -260,9 +260,20 @@ targetTabButton = await pollForElement(() => document.querySelector(`.headerTabs button[data-index="${currentTabIndex}"]`), 50, 100); } + if (targetTabButton.classList.contains('emby-tab-button-active')) { + LOG('Target tab is already active'); + return; + } + const pageTabContents = document.querySelectorAll('.libraryPage:not(.hide) .pageTabContent'); const targetPageTabContent = document.querySelector(`.libraryPage:not(.hide) .pageTabContent[data-index="${currentTabIndex}"]`); + const sectionsContainer = targetPageTabContent?.querySelector('.sections'); + if (sectionsContainer && sectionsContainer.children.length === 0) { + LOG('Sections container is empty, waiting for sections to be rendered'); + return; + } + if (headerTabButtons && targetTabButton && pageTabContents && targetPageTabContent) { // Remove is-active class from all tab buttons headerTabButtons.forEach(button => { @@ -493,7 +504,7 @@ // Sync active tab state when page view changes // This is only necessary for the home page with custom tabs - if (view === 'home' || view === 'home.html') { + if ((view === 'home' || view === 'home.html')) { syncActiveTabState(currentTabIndex).catch(err => { ERR('Error in syncActiveTabState:', err); });