mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-15 18:13:40 +03:00
quick fix for routes refreshing constantly
This commit is contained in:
@@ -41,11 +41,16 @@ class RouterHook extends Logger {
|
||||
const DeckyWrapper = ({ children }: { children: ReactElement }) => {
|
||||
const { routes } = useDeckyRouterState();
|
||||
|
||||
const routerIndex = children.props.children[0].props.children.length;
|
||||
let routerIndex = children.props.children[0].props.children.length;
|
||||
if (
|
||||
!children.props.children[0].props.children[routerIndex]?.length ||
|
||||
children.props.children[0].props.children[routerIndex].length !== routes.size
|
||||
!children.props.children[0].props.children[routerIndex - 1]?.length ||
|
||||
children.props.children[0].props.children[routerIndex - 1]?.length !== routes.size
|
||||
) {
|
||||
if (
|
||||
children.props.children[0].props.children[routerIndex - 1]?.length &&
|
||||
children.props.children[0].props.children[routerIndex - 1].length !== routes.size
|
||||
)
|
||||
routerIndex--;
|
||||
const newRouterArray: ReactElement[] = [];
|
||||
routes.forEach(({ component, props }, path) => {
|
||||
newRouterArray.push(
|
||||
|
||||
Reference in New Issue
Block a user