Fix issue with headerTabs preventing native home screen tabs from loading

This commit is contained in:
HighImKevin committed 2026-02-05 19:34:05 -05:00
1 parent 4e0c1590e4
commit da6489debb
1 file changed
+12 -1
+12 -1
View File
@@ -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);
});