summaryrefslogtreecommitdiff
path: root/frontend/src/router-hook.tsx
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2026-11-21 21:14:41 -0500
committerAAGaming <aagaming@riseup.net>2026-11-21 21:14:41 -0500
commit02db20f846857374b9b5f1e7dbd475befdf47b71 (patch)
tree55c7553d32ffb55e3f490d153543fb96ed9bb71a /frontend/src/router-hook.tsx
parentffd103b9c1a4ce5bf305e7c0998eda6e05457dad (diff)
downloaddecky-loader-02db20f846857374b9b5f1e7dbd475befdf47b71.tar.gz
decky-loader-02db20f846857374b9b5f1e7dbd475befdf47b71.zip
esmodule support base
Diffstat (limited to 'frontend/src/router-hook.tsx')
-rw-r--r--frontend/src/router-hook.tsx19
1 files changed, 4 insertions, 15 deletions
diff --git a/frontend/src/router-hook.tsx b/frontend/src/router-hook.tsx
index a7b6ec92..bf1198fc 100644
--- a/frontend/src/router-hook.tsx
+++ b/frontend/src/router-hook.tsx
@@ -5,7 +5,7 @@ import {
afterPatch,
findInReactTree,
findInTree,
- findModuleByExport,
+ findVar,
getReactRoot,
sleep,
} from '@decky/ui';
@@ -56,20 +56,9 @@ class RouterHook extends Logger {
window.__ROUTER_HOOK_INSTANCE?.deinit?.();
window.__ROUTER_HOOK_INSTANCE = this;
- const reactRouterStackModule = findModuleByExport((e) => typeof e == 'string' && e == 'router-backstack', 20);
- if (reactRouterStackModule) {
- this.Route =
- Object.values(reactRouterStackModule).find(
- (e) => typeof e == 'function' && /routePath:[\w$]+\.match\?\.path./.test(e.toString()),
- ) ||
- Object.values(reactRouterStackModule).find(
- (e) => typeof e == 'function' && /routePath:null===\(.=.\.match\)/.test(e.toString()),
- );
- if (!this.Route) {
- this.error('Failed to find Route component');
- }
- } else {
- this.error('Failed to find router stack module');
+ this.Route = findVar((e) => /routePath:[\w$]+\.match\?\.path./.test(e.toString()))
+ if (!this.Route) {
+ this.error('Failed to find Route component');
}
this.modeChangeRegistration = SteamClient.UI.RegisterForUIModeChanged((mode: EUIMode) => {