From e1b138bcbdcb899e43166a9ece5173d0fc0cab0a Mon Sep 17 00:00:00 2001
From: Beebles <102569435+beebls@users.noreply.github.com>
Date: Fri, 17 Feb 2023 18:27:20 -0700
Subject: Fix fullscreen route inject issues caused by Feb. 17th beta. (#372)

* remove gamepad ui

* Refactor
---
 frontend/src/router-hook.tsx | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'frontend/src/router-hook.tsx')

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) => {
-- 
cgit v1.2.3

