summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/components/Toast.tsx14
-rw-r--r--frontend/src/components/store/Store.tsx2
-rw-r--r--frontend/src/errorboundary-hook.tsx5
-rw-r--r--frontend/src/hooks/router.tsx2
-rw-r--r--frontend/src/hooks/vr-dashboard-bar.tsx7
-rw-r--r--frontend/src/index.ts20
6 files changed, 27 insertions, 23 deletions
diff --git a/frontend/src/components/Toast.tsx b/frontend/src/components/Toast.tsx
index aa2e665f..8b6b9d63 100644
--- a/frontend/src/components/Toast.tsx
+++ b/frontend/src/components/Toast.tsx
@@ -24,13 +24,13 @@ interface ToastRendererProps extends ToastProps {
}
const popupClasses = {
- "ShortTemplate": "kg8VJS07NZk-",
- "Content": "vjeKRorxqWY-",
- "Header": "UWjdKshdhD8-",
- "Icon": "q9vQBNOskjU-",
- "Title": "RZ1644uUH-k-",
- "Body": "_5LTIC-a3DVw-"
-}
+ ShortTemplate: 'kg8VJS07NZk-',
+ Content: 'vjeKRorxqWY-',
+ Header: 'UWjdKshdhD8-',
+ Icon: 'q9vQBNOskjU-',
+ Title: 'RZ1644uUH-k-',
+ Body: '_5LTIC-a3DVw-',
+};
// These are memoized as they like to randomly rerender
diff --git a/frontend/src/components/store/Store.tsx b/frontend/src/components/store/Store.tsx
index da909fd7..e66899be 100644
--- a/frontend/src/components/store/Store.tsx
+++ b/frontend/src/components/store/Store.tsx
@@ -7,7 +7,7 @@ import {
SteamSpinner,
Tabs,
TextField,
- tabsClasses
+ tabsClasses,
} from '@decky/ui';
import { Dispatch, FC, SetStateAction, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/frontend/src/errorboundary-hook.tsx b/frontend/src/errorboundary-hook.tsx
index 2bbecc58..0c98c6ff 100644
--- a/frontend/src/errorboundary-hook.tsx
+++ b/frontend/src/errorboundary-hook.tsx
@@ -26,7 +26,10 @@ class ErrorBoundaryHook extends Logger {
// valve writes only the sanest of code
const exp = /^\(\)=>\([\w$]+\|\|(?:[\w$]+\(|\([\w$]+=)new [\w$]+\),[\w$]+\)$/;
const initErrorReportingStore = findModuleExport(
- (e) => typeof e == 'function' && e?.toString && (exp.test(e.toString()) || e.toString() == "()=>(store||=new CErrorReportingStore,store)"),
+ (e) =>
+ typeof e == 'function' &&
+ e?.toString &&
+ (exp.test(e.toString()) || e.toString() == '()=>(store||=new CErrorReportingStore,store)'),
);
if (!initErrorReportingStore) {
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 &&
diff --git a/frontend/src/index.ts b/frontend/src/index.ts
index 162e8f36..f21c4802 100644
--- a/frontend/src/index.ts
+++ b/frontend/src/index.ts
@@ -2,9 +2,9 @@
interface Window {
_deckyModuleResolverInternals: {
- scopes: Map<string, Record<string, any>>,
- scopedObjects: Map<number, any>
- }
+ scopes: Map<string, Record<string, any>>;
+ scopedObjects: Map<number, any>;
+ };
}
interface SteamAppInitialization {
@@ -23,7 +23,7 @@ const isSteamAppInitialized = () => {
console.debug('[Decky:Boot] Authenticating with Decky backend...');
window.deckyAuthToken = await fetch('http://127.0.0.1:1337/auth/token').then((r) => r.text());
console.debug('[Decky:Boot] Connecting to Decky backend...');
- const ws = window.DeckyBackend = new (await import('./wsrouter')).WSRouter();
+ const ws = (window.DeckyBackend = new (await import('./wsrouter')).WSRouter());
await ws.connect();
console.time('[Decky:Boot] Waiting for SteamApp init stage 1 to finish...');
@@ -35,19 +35,19 @@ const isSteamAppInitialized = () => {
console.debug('[Decky:Boot] Setting up Module System & React globals...');
let moduleId = 0;
- const int = window._deckyModuleResolverInternals = {
+ const int = (window._deckyModuleResolverInternals = {
scopes: new Map(),
- scopedObjects: new Map()
- };
- const resolveThroughBackend = ws.callable<[objectKey: number]>("instrumentation/resolve_scope");
+ scopedObjects: new Map(),
+ });
+ const resolveThroughBackend = ws.callable<[objectKey: number]>('instrumentation/resolve_scope');
async function resolveModuleScope(objectFromScope: any, moduleForDebug?: string) {
let ret;
const id = ++moduleId;
try {
- int.scopedObjects.set(id, objectFromScope)
+ int.scopedObjects.set(id, objectFromScope);
await resolveThroughBackend(id);
ret = int.scopes.get(id);
- } catch(e) {
+ } catch (e) {
console.debug(`[Decky:Instrumentation] Scope resolution failed for module ${moduleForDebug}`, e);
} finally {
int.scopes.delete(id);