Merge branch 'dev'

This commit is contained in:
cocobo1 2025-11-14 18:35:02 +02:00
commit 5ceb4b8935

View file

@ -80,19 +80,26 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
});
});
unpatches.push(after("default", SettingsOverviewScreen, (_, ret) => {
if (useIsFirstRender()) return; // :shrug:
const { sections } = findInReactTree(ret, i => i.props?.sections).props;
// Credit to @palmdevs - https://discord.com/channels/1196075698301968455/1243605828783571024/1307940348378742816
let index = -~sections.findIndex((i: any) => i.settings.includes("ACCOUNT")) || 1;
const createListModule = findByPropsLazy("createList");
unpatches.push(after("createList", createListModule, function(args, ret) {
const [config] = args;
if (config?.sections && Array.isArray(config.sections)) {
const sections = config.sections;
let index = -~sections.findIndex((i: any) => i.settings?.includes("ACCOUNT")) || 1;
Object.keys(registeredSections).forEach(sect => {
sections.splice(index++, 0, {
label: sect,
title: sect,
settings: registeredSections[sect].map(a => a.key)
});
const alreadyExists = sections.some((s: any) => s.label === sect);
if (!alreadyExists) {
sections.splice(index++, 0, {
label: sect,
title: sect,
settings: registeredSections[sect].map(a => a.key)
});
}
});
}));
}
}
return ret;
}))};