diff --git a/src/components/CustomTabContainer.tsx b/src/components/CustomTabContainer.tsx index 912a8d3..71e7d67 100644 --- a/src/components/CustomTabContainer.tsx +++ b/src/components/CustomTabContainer.tsx @@ -55,7 +55,10 @@ export class CustomTabContainer implements TabContainer { this.checkMicroSDeckDependency(); } - getActualTab(TabContentComponent: TabContentComponent, sortingProps: Omit, footer: SteamTab['footer'], collectionAppFilter: any): SteamTab { + getActualTab(TabContentComponent: TabContentComponent, sortingProps: Omit, footer: SteamTab['footer'], collectionAppFilter: any, isMicroSDeckInstalled: boolean): SteamTab | null { + if (!isMicroSDeckInstalled && this.dependsOnMicroSDeck) return null; + if (this.autoHide && this.collection.visibleApps.length === 0) return null; + return { title: this.title, id: this.id, diff --git a/src/patches/LibraryPatch.tsx b/src/patches/LibraryPatch.tsx index e481a5b..cb76565 100644 --- a/src/patches/LibraryPatch.tsx +++ b/src/patches/LibraryPatch.tsx @@ -87,11 +87,7 @@ export const patchLibrary = (serverAPI: ServerAPI, tabMasterManager: TabMasterMa pacthedTabs = tablist.flatMap((tabContainer) => { if (tabContainer.filters) { const footer = { ...(tabTemplate!.footer ?? {}), onMenuButton: getShowMenu(tabContainer.id, tabMasterManager), onMenuActionDescription: 'Tab Master' }; - - //if MicroSDeck isn't installed don't display any tabs that depend on it; return empty array for flat map - if (!isMicroSDeckInstalled && (tabContainer as CustomTabContainer).dependsOnMicroSDeck) return []; - if ((tabContainer as CustomTabContainer).autoHide && (tabContainer as CustomTabContainer).collection.visibleApps.length === 0) return []; - return (tabContainer as CustomTabContainer).getActualTab(tabContentComponent, sortingProps, footer, collectionsAppFilterGamepad); + return (tabContainer as CustomTabContainer).getActualTab(tabContentComponent, sortingProps, footer, collectionsAppFilterGamepad, isMicroSDeckInstalled) || []; } else { return tabs.find(actualTab => { if (actualTab.id === tabContainer.id) {