[PCCompat > Settings] Change settings placement like new GM v8

This commit is contained in:
Ducko 2021-04-08 11:20:53 +01:00 committed by フズキ
parent a6e70a41dd
commit b7d70c2b53
No known key found for this signature in database
GPG Key ID: E06450E46F83376C
1 changed files with 3 additions and 4 deletions

View File

@ -9,13 +9,12 @@ export const registerSettings = (id, { label, render, category }) => {
const FormSection = goosemodScope.webpackModules.findByDisplayName('FormSection');
goosemodScope.patcher.inject(id, SettingsView.prototype, 'getPredicateSections', (_, sections) => {
if (!sections.find(c => c.section === 'changelog')) return sections;
const dividers = sections.filter(c => c.section === 'DIVIDER');
const logout = sections.find((c) => c.section === 'logout');
if (!logout) return sections;
const finalLabel = typeof label === 'function' ? label() : label;
sections.splice(sections.indexOf(dividers[dividers.length - 2]) - 2, 0,
sections.splice(sections.indexOf(logout) - 1, 0,
{
section: finalLabel,
label: finalLabel,