Skip to content

Commit

Permalink
fix: settings page patches properly on beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Jun 27, 2024
1 parent d345485 commit 7d837ca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/patches/SettingsPatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const patchSettings = (serverAPI: ServerAPI, tabMasterManager: TabMasterM
}

afterPatch(ret1, 'type', (_: any, ret2: any) => {
const homeElement = ret2?.props?.children?.props?.pages?.find((obj: any) => obj.route === '/settings/home')?.content?.props?.children?.[1];
const homeElement = ret2?.props?.children?.props?.pages?.find((obj: any) => obj.route === '/settings/home')?.content;
if (homeElement === undefined) {
LogController.raiseError("Couldn't find home element to patch in settings");
return ret2;
Expand All @@ -44,8 +44,6 @@ export const patchSettings = (serverAPI: ServerAPI, tabMasterManager: TabMasterM
}

afterPatch(buttonElementContainer, 'type', (_: any, ret4: any) => {
console.log('ret 4', ret4);

//* if ret exists but cannot find onClick then raise error because it is assumed valve has changed something
if (ret4 && !ret4.props?.onClick) {
LogController.raiseError("Couldn't patch button onClick fn in settings");
Expand Down

0 comments on commit 7d837ca

Please sign in to comment.