Skip to content

Commit

Permalink
fix(tabs): fix on stable for real this time i think
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Oct 28, 2022
1 parent fb49d64 commit a074277
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/deck-components/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,30 @@ try {
}
return false;
});
if (oldTabsModule) oldTabs = Object.values(oldTabsModule).find((x: any) => x?.type?.toString()?.includes("((function(") && x?.type?.toString()?.includes("[\"tabs\""));
if (oldTabsModule)
oldTabs = Object.values(oldTabsModule).find((x: any) => x?.type?.toString()?.includes('((function(){'));
} catch (e) {
console.error("Error finding oldTabs:", e)
console.error('Error finding oldTabs:', e);
}

/**
* Tabs component as used in the library and media tabs. See {@link TabsProps}
* Unlike other components in `decky-frontend-lib`, this requires Decky Loader to be running.
*/
export const Tabs = oldTabs || ((props: TabsProps) => {
const found = tabsComponent;
const [tc, setTC] = useState<FC<TabsProps>>(found);
useEffect(() => {
if (found) return;
(async () => {
console.debug('[DFL:Tabs]: Finding component...');
const t = await getTabs();
console.debug('[DFL:Tabs]: Found!');
setTC(t);
})();
}, []);
console.log('tc', tc);
return tc ? createElement(tc, props) : <SteamSpinner />;
}) as FC<TabsProps>;
export const Tabs =
oldTabs ||
(((props: TabsProps) => {
const found = tabsComponent;
const [tc, setTC] = useState<FC<TabsProps>>(found);
useEffect(() => {
if (found) return;
(async () => {
console.debug('[DFL:Tabs]: Finding component...');
const t = await getTabs();
console.debug('[DFL:Tabs]: Found!');
setTC(t);
})();
}, []);
console.log('tc', tc);
return tc ? createElement(tc, props) : <SteamSpinner />;
}) as FC<TabsProps>);

0 comments on commit a074277

Please sign in to comment.