summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/components/TitleView.tsx1
-rw-r--r--frontend/src/components/settings/pages/testing/index.tsx6
-rw-r--r--frontend/src/components/store/Store.tsx1
-rw-r--r--frontend/src/index.ts10
-rw-r--r--frontend/src/tabs-hook.tsx25
-rw-r--r--frontend/src/toaster.tsx1
6 files changed, 30 insertions, 14 deletions
diff --git a/frontend/src/components/TitleView.tsx b/frontend/src/components/TitleView.tsx
index 0cb82b7f..cce779ff 100644
--- a/frontend/src/components/TitleView.tsx
+++ b/frontend/src/components/TitleView.tsx
@@ -8,7 +8,6 @@ import { useDeckyState } from './DeckyState';
const titleStyles: CSSProperties = {
display: 'flex',
- paddingTop: '3px',
paddingRight: '16px',
position: 'sticky',
top: '0px',
diff --git a/frontend/src/components/settings/pages/testing/index.tsx b/frontend/src/components/settings/pages/testing/index.tsx
index 3c032361..0f8b5ebe 100644
--- a/frontend/src/components/settings/pages/testing/index.tsx
+++ b/frontend/src/components/settings/pages/testing/index.tsx
@@ -66,9 +66,9 @@ export default function TestingVersionList() {
if (testingVersions.length === 0) {
return (
- <div>
+ <DialogBody>
<p>No open PRs found</p>
- </div>
+ </DialogBody>
);
}
@@ -80,7 +80,7 @@ export default function TestingVersionList() {
<ul style={{ listStyleType: 'none', padding: '0' }}>
{testingVersions.map((version) => {
return (
- <li>
+ <li key={`${version.id}_${version.name}`}>
<Field
label={
<>
diff --git a/frontend/src/components/store/Store.tsx b/frontend/src/components/store/Store.tsx
index 72187cbc..f1d50033 100644
--- a/frontend/src/components/store/Store.tsx
+++ b/frontend/src/components/store/Store.tsx
@@ -240,6 +240,7 @@ const BrowseTab: FC<{ setPluginCount: Dispatch<SetStateAction<number | null>> }>
})
.map((plugin: StorePlugin) => (
<PluginCard
+ key={`${plugin.id}_${plugin.name}`}
storePlugin={plugin}
installedPlugin={installedPlugins.find((installedPlugin) => installedPlugin.name === plugin.name)}
/>
diff --git a/frontend/src/index.ts b/frontend/src/index.ts
index 4f4ff4f7..7ef5087f 100644
--- a/frontend/src/index.ts
+++ b/frontend/src/index.ts
@@ -22,11 +22,13 @@
DFLWebpack.findModule((m) => m.createPortal && m.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE);
console.debug('[Decky:Boot] Setting up JSX internals...');
- const jsx = DFLWebpack.findModule((m) => m.jsx && Object.keys(m).length == 1)?.jsx;
- if (jsx) {
+ const jsxModule = DFLWebpack.findModule((m) => (m.jsx && m.jsxs) || (m.jsx && Object.keys(m).length == 1));
+ if (jsxModule.jsxs) {
+ window.SP_JSX = jsxModule;
+ } else {
window.SP_JSX = {
- jsx,
- jsxs: jsx,
+ jsx: jsxModule.jsx,
+ jsxs: jsxModule.jsx,
Fragment: window.SP_REACT.Fragment,
};
}
diff --git a/frontend/src/tabs-hook.tsx b/frontend/src/tabs-hook.tsx
index a70c6580..5d9518fd 100644
--- a/frontend/src/tabs-hook.tsx
+++ b/frontend/src/tabs-hook.tsx
@@ -29,7 +29,8 @@ interface Tab {
class TabsHook extends Logger {
// private keys = 7;
tabs: Tab[] = [];
- private qamPatch?: Patch;
+ private qamBrowserViewPatch?: Patch;
+ private qamEmbeddedPatch?: Patch;
constructor() {
super('TabsHook');
@@ -40,11 +41,13 @@ class TabsHook extends Logger {
}
init() {
- // TODO patch the "embedded" renderer in this module too (seems to be for VR? unsure)
const qamModule = findModuleByExport((e) => e?.type?.toString?.()?.includes('QuickAccessMenuBrowserView'));
- const qamRenderer = Object.values(qamModule).find((e: any) =>
+ const qamBrowserViewRenderer = Object.values(qamModule).find((e: any) =>
e?.type?.toString?.()?.includes('QuickAccessMenuBrowserView'),
);
+ const qamEmbeddedRenderer = Object.values(qamModule).find((e: any) =>
+ e?.type?.toString?.()?.includes('QuickAccessMenuEmbedded'),
+ );
const patchHandler = createReactTreePatcher(
[(tree) => findInReactTree(tree, (node) => node?.props?.onFocusNavDeactivated)],
@@ -56,12 +59,21 @@ class TabsHook extends Logger {
'TabsHook',
);
- this.qamPatch = afterPatch(qamRenderer, 'type', patchHandler);
+ this.qamBrowserViewPatch = afterPatch(qamBrowserViewRenderer, 'type', patchHandler);
+ if (qamEmbeddedRenderer) this.qamEmbeddedPatch = afterPatch(qamEmbeddedRenderer, 'type', patchHandler);
// Patch already rendered qam
const root = getReactRoot(document.getElementById('root') as any);
- const qamNode = root && findInReactTree(root, (n: any) => n.elementType == qamRenderer); // need elementType, because type is actually mobx wrapper
+ const qamNode =
+ root &&
+ findInReactTree(
+ root,
+ (n: any) =>
+ n.elementType == qamBrowserViewRenderer ||
+ (qamEmbeddedRenderer != null && n.elementType == qamEmbeddedRenderer),
+ ); // need elementType, because type is actually mobx wrapper
if (qamNode) {
+ console.log('patching existing qam');
// Only affects this fiber node so we don't need to unpatch here
qamNode.type = qamNode.elementType.type;
if (qamNode?.alternate) {
@@ -71,7 +83,8 @@ class TabsHook extends Logger {
}
deinit() {
- this.qamPatch?.unpatch();
+ this.qamBrowserViewPatch?.unpatch();
+ this.qamEmbeddedPatch?.unpatch();
}
add(tab: Tab) {
diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index 2305b870..99f8023e 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -81,6 +81,7 @@ class Toaster extends Logger {
const info = {
showToast: toast.showToast,
sound: toast.sound,
+ playSound: toast.playSound,
eFeature: 0,
toastDurationMS: toastData.nToastDurationMS,
bCritical: toast.critical,