prevent future issues where toString may not be a function (what)

This commit is contained in:
AAGaming
2024-10-11 14:47:20 -04:00
parent 1781c19c11
commit 43aa0497f4
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ class RouterHook extends Logger {
private async patchDesktopRouter() {
const root = getReactRoot(document.getElementById('root') as any);
const findRouterNode = () =>
findInReactTree(root, (node) => node?.elementType?.type?.toString()?.includes('bShowDesktopUIContent:'));
findInReactTree(root, (node) => node?.elementType?.type?.toString?.()?.includes('bShowDesktopUIContent:'));
let routerNode = findRouterNode();
while (!routerNode) {
this.warn('Failed to find Router node, reattempting in 5 seconds.');