Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
23af4c0bb4 chore(release): 3.7.9 [CI SKIP] 2022-10-28 22:43:16 +00:00
AAGaming
a074277bb5 fix(tabs): fix on stable for real this time i think 2022-10-28 18:42:28 -04:00
3 changed files with 28 additions and 18 deletions

View File

@@ -1,3 +1,10 @@
## [3.7.9](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.8...v3.7.9) (2022-10-28)
### Bug Fixes
* **tabs:** fix on stable for real this time i think ([a074277](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/a074277bb58428a64295154ebf96aceb96e654a7))
## [3.7.8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.7...v3.7.8) (2022-10-26) ## [3.7.8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.7...v3.7.8) (2022-10-26)

View File

@@ -1,6 +1,6 @@
{ {
"name": "decky-frontend-lib", "name": "decky-frontend-lib",
"version": "3.7.8", "version": "3.7.9",
"description": "A library for building decky plugins", "description": "A library for building decky plugins",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@@ -109,27 +109,30 @@ try {
} }
return false; 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) { } 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} * 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. * Unlike other components in `decky-frontend-lib`, this requires Decky Loader to be running.
*/ */
export const Tabs = oldTabs || ((props: TabsProps) => { export const Tabs =
const found = tabsComponent; oldTabs ||
const [tc, setTC] = useState<FC<TabsProps>>(found); (((props: TabsProps) => {
useEffect(() => { const found = tabsComponent;
if (found) return; const [tc, setTC] = useState<FC<TabsProps>>(found);
(async () => { useEffect(() => {
console.debug('[DFL:Tabs]: Finding component...'); if (found) return;
const t = await getTabs(); (async () => {
console.debug('[DFL:Tabs]: Found!'); console.debug('[DFL:Tabs]: Finding component...');
setTC(t); const t = await getTabs();
})(); console.debug('[DFL:Tabs]: Found!');
}, []); setTC(t);
console.log('tc', tc); })();
return tc ? createElement(tc, props) : <SteamSpinner />; }, []);
}) as FC<TabsProps>; console.log('tc', tc);
return tc ? createElement(tc, props) : <SteamSpinner />;
}) as FC<TabsProps>);