diff options
| author | AAGaming <aagaming@riseup.net> | 2024-06-27 00:09:00 -0400 |
|---|---|---|
| committer | AAGaming <aagaming@riseup.net> | 2024-06-27 00:09:00 -0400 |
| commit | d067fe6361b6bebd2d1ae4adff2cf3e49cbd99fe (patch) | |
| tree | ac65d9df2a083644c54896767a0bf5670bd8bd84 /frontend/src/router-hook.tsx | |
| parent | c02a78ed6e1d9c21e84b60d9a5b077d0ee547a8f (diff) | |
| download | decky-loader-d067fe6361b6bebd2d1ae4adff2cf3e49cbd99fe.tar.gz decky-loader-d067fe6361b6bebd2d1ae4adff2cf3e49cbd99fe.zip | |
add some errorboundaries
Diffstat (limited to 'frontend/src/router-hook.tsx')
| -rw-r--r-- | frontend/src/router-hook.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/frontend/src/router-hook.tsx b/frontend/src/router-hook.tsx index a42c2daa..7b66d351 100644 --- a/frontend/src/router-hook.tsx +++ b/frontend/src/router-hook.tsx @@ -1,4 +1,4 @@ -import { Export, Patch, afterPatch, findModuleExport } from '@decky/ui'; +import { ErrorBoundary, Focusable, Patch, afterPatch } from '@decky/ui'; import { FC, ReactElement, ReactNode, cloneElement, createElement, memo } from 'react'; import type { Route } from 'react-router'; @@ -41,9 +41,7 @@ class RouterHook extends Logger { window.__ROUTER_HOOK_INSTANCE?.deinit?.(); window.__ROUTER_HOOK_INSTANCE = this; - this.gamepadWrapper = findModuleExport((e: Export) => - e?.render?.toString()?.includes('["flow-children","onActivate","onCancel","focusClassName",'), - ); + this.gamepadWrapper = Focusable; let Route: new () => Route; // Used to store the new replicated routes we create to allow routes to be unpatched. @@ -63,7 +61,9 @@ class RouterHook extends Logger { routes.forEach(({ component, props }, path) => { newRouterArray.push( <Route path={path} {...props}> - {createElement(component)} + <ErrorBoundary> + {createElement(component)} + </ErrorBoundary> </Route>, ); }); |
