summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/src/router-hook.tsx8
1 files changed, 3 insertions, 5 deletions
diff --git a/frontend/src/router-hook.tsx b/frontend/src/router-hook.tsx
index bf3ae0cb..cfacaddd 100644
--- a/frontend/src/router-hook.tsx
+++ b/frontend/src/router-hook.tsx
@@ -123,11 +123,9 @@ class RouterHook extends Logger {
this.wrapperPatch = afterPatch(this.gamepadWrapper, 'render', (_: any, ret: any) => {
if (ret?.props?.children?.props?.children?.length == 5 || ret?.props?.children?.props?.children?.length == 4) {
const idx = ret?.props?.children?.props?.children?.length == 4 ? 1 : 2;
- if (
- ret.props.children.props.children[idx]?.props?.children?.[0]?.type?.type
- ?.toString()
- ?.includes('GamepadUI.Settings.Root()')
- ) {
+ const potentialSettingsRootString =
+ ret.props.children.props.children[idx]?.props?.children?.[0]?.type?.type?.toString() || '';
+ if (potentialSettingsRootString?.includes('Settings.Root()')) {
if (!this.router) {
this.router = ret.props.children.props.children[idx]?.props?.children?.[0]?.type;
this.routerPatch = afterPatch(this.router, 'type', (_: any, ret: any) => {