Skip to content

Commit

Permalink
fix: crash when opening noti settings
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed May 29, 2024
1 parent ca25639 commit 1c15174
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/ui/settings/patches/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ export function patchPanelUI(unpatches: (() => void | boolean)[]) {
const sections = findInReactTree(
res.props.children,
n => n?.children?.[1]?.type === LegacyFormSection
).children;
)?.children;

const index = sections.findIndex((c: any) => titles.includes(c?.props.label));
sections.splice(-~index || 4, 0, <SettingsSection />);
if (sections) {
const index = sections.findIndex((c: any) => titles.includes(c?.props.label));
sections.splice(-~index || 4, 0, <SettingsSection />);
}
}));
}, true);

Expand Down

0 comments on commit 1c15174

Please sign in to comment.