summaryrefslogtreecommitdiff
path: root/frontend/src/router-hook.tsx
diff options
context:
space:
mode:
authorAAGaming <aa@mail.catvibers.me>2023-07-03 23:57:53 -0400
committerAAGaming <aa@mail.catvibers.me>2023-07-03 23:57:53 -0400
commitdea08868d3b7f482a9b94be9a0b5e25d6633d9e9 (patch)
tree47457f36297266eb970b4f39bdbf75803c0595a0 /frontend/src/router-hook.tsx
parent365866c35fdd68e8d6075ead3d196c7713728bbe (diff)
downloaddecky-loader-dea08868d3b7f482a9b94be9a0b5e25d6633d9e9.tar.gz
decky-loader-dea08868d3b7f482a9b94be9a0b5e25d6633d9e9.zip
fix router hook recursively wrapping routes when patched multiple timesv2.10.4-pre1
Diffstat (limited to 'frontend/src/router-hook.tsx')
-rw-r--r--frontend/src/router-hook.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/frontend/src/router-hook.tsx b/frontend/src/router-hook.tsx
index cfacaddd..28f6923c 100644
--- a/frontend/src/router-hook.tsx
+++ b/frontend/src/router-hook.tsx
@@ -22,6 +22,8 @@ declare global {
}
}
+const isPatched = Symbol('is patched');
+
class RouterHook extends Logger {
private router: any;
private memoizedRouter: any;
@@ -90,9 +92,10 @@ class RouterHook extends Logger {
...routeList[index].props,
children: {
...cloneElement(routeList[index].props.children),
- type: (props) => createElement(oType, props),
+ type: routeList[index].props.children[isPatched] ? oType : (props) => createElement(oType, props),
},
}).children;
+ routeList[index].props.children[isPatched] = true;
});
}
});