mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Fix issue with headerTabs preventing native home screen tabs from loading
This commit is contained in:
1 parent
4e0c1590e4
commit
da6489debb
1 file changed
+12
-1
+12
-1
@@ -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);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user