From 7b68170549be09152378bec340ee478a0509231c Mon Sep 17 00:00:00 2001 From: AAGaming Date: Sat, 21 Nov 2026 21:57:39 -0500 Subject: small cleanups --- frontend/src/hooks/router.tsx | 2 +- frontend/src/hooks/toaster.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/router.tsx b/frontend/src/hooks/router.tsx index 0c8eb01a..95fd8eeb 100644 --- a/frontend/src/hooks/router.tsx +++ b/frontend/src/hooks/router.tsx @@ -56,7 +56,7 @@ class RouterHook extends Logger { window.__ROUTER_HOOK_INSTANCE?.deinit?.(); window.__ROUTER_HOOK_INSTANCE = this; - this.Route = findVar((e) => /routePath:[\w$]+\.match\?\.path./.test(e.toString())); + this.Route = findVar((e) => typeof e == 'function' && /routePath:[\w$]+\.match\?\.path./.test(e.toString())); if (!this.Route) { this.error('Failed to find Route component'); } diff --git a/frontend/src/hooks/toaster.tsx b/frontend/src/hooks/toaster.tsx index d7f76272..cc604d0f 100644 --- a/frontend/src/hooks/toaster.tsx +++ b/frontend/src/hooks/toaster.tsx @@ -28,7 +28,9 @@ class Toaster extends Logger { window.__TOASTER_INSTANCE = this; // TODO regex? - const ValveToastRenderer = findVar((e) => e?.toString?.()?.includes(`controller:\`notification\`,method:`)); + const ValveToastRenderer = findVar( + (e) => typeof e == 'function' && e?.toString?.()?.includes(`controller:\`notification\`,method:`), + ); // TODO find a way to undo this if possible? const patchedRenderer = injectFCTrampoline(ValveToastRenderer); this.toastPatch = replacePatch(patchedRenderer, 'component', (args: any[]) => { -- cgit v1.2.3