summaryrefslogtreecommitdiff
path: root/frontend/src/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/hooks')
-rw-r--r--frontend/src/hooks/router.tsx2
-rw-r--r--frontend/src/hooks/vr-dashboard-bar.tsx7
2 files changed, 5 insertions, 4 deletions
diff --git a/frontend/src/hooks/router.tsx b/frontend/src/hooks/router.tsx
index bb1bfdba..0c8eb01a 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) => /routePath:[\w$]+\.match\?\.path./.test(e.toString()));
if (!this.Route) {
this.error('Failed to find Route component');
}
diff --git a/frontend/src/hooks/vr-dashboard-bar.tsx b/frontend/src/hooks/vr-dashboard-bar.tsx
index 905aee03..3fe1ad73 100644
--- a/frontend/src/hooks/vr-dashboard-bar.tsx
+++ b/frontend/src/hooks/vr-dashboard-bar.tsx
@@ -1,5 +1,5 @@
// Hook the SteamVR Hotbar
-import { ErrorBoundary, Patch, afterPatch, findInReactTree, findModuleExport, getReactRoot } from '@decky/ui';
+import { ErrorBoundary, Patch, afterPatch, findInReactTree, findVar, getReactRoot } from '@decky/ui';
import { ReactNode, createElement } from 'react';
import Logger from '../logger';
@@ -41,8 +41,8 @@ class VRDashboardBarHook extends Logger {
}
init() {
- this.barButton = findModuleExport((e) => e?.render?.toString()?.includes('VRDashboardBarSmallButtonActive'));
- const barComponent = findModuleExport((e) => e?.type?.toString()?.includes('vrLocation=="dashboard-bar"'));
+ this.barButton = findVar((e) => e?.render?.toString()?.includes('VRDashboardBarSmallButtonActive'));
+ const barComponent = findVar((e) => e?.type?.toString()?.includes('vrLocation==`dashboard-bar`'));
this.barPatch = afterPatch(barComponent, 'type', (_, ret) => {
const nodes = findInReactTree(ret, (x) => x?.length > 6);
@@ -51,6 +51,7 @@ class VRDashboardBarHook extends Logger {
});
// Patch already rendered bar
+ // THIS DOES NOT WORK so frame needs a lockscreen for now :/
const root = getReactRoot(document.getElementById('root') as any);
const barNode =
root &&