Skip to content

Commit

Permalink
fix(Navigation): fix on stable
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Jan 16, 2023
1 parent 6b3db72 commit 4affd4a
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/deck-components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,29 +130,29 @@ export let Navigation = {} as Navigation;

try {
(async () => {
// With how much Valve is changing these, you really shouldn't use them directly, instead see Navigation
let InternalNavigators: any;
function initInternalNavigators() {
try {
InternalNavigators = findModuleChild((m: any) => {
if (typeof m !== 'object') return undefined;
for (let prop in m) {
if (m[prop]?.GetNavigator) {
return m[prop];
let InternalNavigators: any = {};
if (!Router.NavigateToAppProperties || (Router as unknown as any).deckyShim) {
function initInternalNavigators() {
try {
InternalNavigators = findModuleChild((m: any) => {
if (typeof m !== 'object') return undefined;
for (let prop in m) {
if (m[prop]?.GetNavigator) {
return m[prop];
}
}
}
})?.GetNavigator();
} catch (e) {
console.error('[DFL:Router]: Failed to init internal navigators, trying again');
})?.GetNavigator();
} catch (e) {
console.error('[DFL:Router]: Failed to init internal navigators, trying again');
}
}
}
initInternalNavigators();
while (!InternalNavigators?.AppProperties) {
console.log('[DFL:Router]: Trying to init internal navigators again');
await sleep(100);
initInternalNavigators();
while (!InternalNavigators?.AppProperties) {
console.log('[DFL:Router]: Trying to init internal navigators again');
await sleep(100);
initInternalNavigators();
}
}
console.log("got navigators", InternalNavigators)
const newNavigation = {
Navigate: Router.Navigate.bind(Router),
NavigateBack: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateBack.bind(
Expand Down

0 comments on commit 4affd4a

Please sign in to comment.