Merge branch 'dev'
This commit is contained in:
commit
5ceb4b8935
1 changed files with 20 additions and 13 deletions
|
|
@ -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;
|
||||
}))};
|
||||
Loading…
Add table
Reference in a new issue