Skip to content

Commit

Permalink
fix nav patch on latest betas
Browse files Browse the repository at this point in the history
  • Loading branch information
beebls committed Feb 15, 2024
1 parent 96a3163 commit 3aa1801
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/deckyPatches/NavControllerFinder.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
import { Module, findModuleChild } from "decky-frontend-lib";

export const NavController = findModuleChild((m: Module) => m?.CFocusNavNode);
export const NavController = findModuleChild((m: Module) => {
if (typeof m !== "object") return undefined;

// Pre Chromium-109
if (m?.CFocusNavNode) {
return m.CFocusNavNode;
}

for (let prop in m) {
if (m[prop]?.prototype?.FindNextFocusableChildInDirection) {
return m[prop];
}
}

return undefined;
});

0 comments on commit 3aa1801

Please sign in to comment.