[PCCompat > Settings] Change settings placement like new GM v8
This commit is contained in:
parent
a6e70a41dd
commit
b7d70c2b53
|
@ -9,13 +9,12 @@ export const registerSettings = (id, { label, render, category }) => {
|
||||||
const FormSection = goosemodScope.webpackModules.findByDisplayName('FormSection');
|
const FormSection = goosemodScope.webpackModules.findByDisplayName('FormSection');
|
||||||
|
|
||||||
goosemodScope.patcher.inject(id, SettingsView.prototype, 'getPredicateSections', (_, sections) => {
|
goosemodScope.patcher.inject(id, SettingsView.prototype, 'getPredicateSections', (_, sections) => {
|
||||||
if (!sections.find(c => c.section === 'changelog')) return sections;
|
const logout = sections.find((c) => c.section === 'logout');
|
||||||
|
if (!logout) return sections;
|
||||||
const dividers = sections.filter(c => c.section === 'DIVIDER');
|
|
||||||
|
|
||||||
const finalLabel = typeof label === 'function' ? label() : label;
|
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,
|
section: finalLabel,
|
||||||
label: finalLabel,
|
label: finalLabel,
|
||||||
|
|
Loading…
Reference in New Issue