summaryrefslogtreecommitdiff
path: root/frontend/src/router-hook.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/router-hook.tsx')
-rw-r--r--frontend/src/router-hook.tsx12
1 files changed, 4 insertions, 8 deletions
diff --git a/frontend/src/router-hook.tsx b/frontend/src/router-hook.tsx
index 28f6923c..7c52e581 100644
--- a/frontend/src/router-hook.tsx
+++ b/frontend/src/router-hook.tsx
@@ -1,4 +1,4 @@
-import { Patch, afterPatch, findModuleChild } from 'decky-frontend-lib';
+import { Export, Patch, afterPatch, findModuleExport } from '@decky/ui';
import { FC, ReactElement, ReactNode, cloneElement, createElement, memo } from 'react';
import type { Route } from 'react-router';
@@ -41,13 +41,9 @@ class RouterHook extends Logger {
window.__ROUTER_HOOK_INSTANCE?.deinit?.();
window.__ROUTER_HOOK_INSTANCE = this;
- this.gamepadWrapper = findModuleChild((m) => {
- if (typeof m !== 'object') return undefined;
- for (let prop in m) {
- if (m[prop]?.render?.toString()?.includes('["flow-children","onActivate","onCancel","focusClassName",'))
- return m[prop];
- }
- });
+ this.gamepadWrapper = findModuleExport((e: Export) =>
+ e?.render?.toString()?.includes('["flow-children","onActivate","onCancel","focusClassName",'),
+ );
let Route: new () => Route;
// Used to store the new replicated routes we create to allow routes to be unpatched.