[PCCompat > Global > Settings] Fixes for some new plugins and better render use

This commit is contained in:
Ducko 2021-05-15 22:03:35 +01:00 committed by フズキ
parent 9817fd9cce
commit 4469096b7b
No known key found for this signature in database
GPG key ID: E06450E46F83376C

View file

@ -8,6 +8,8 @@ export const registerSettings = (id, { label, render, category }) => {
const FormTitle = goosemodScope.webpackModules.findByDisplayName('FormTitle'); const FormTitle = goosemodScope.webpackModules.findByDisplayName('FormTitle');
const FormSection = goosemodScope.webpackModules.findByDisplayName('FormSection'); const FormSection = goosemodScope.webpackModules.findByDisplayName('FormSection');
if (!Settings.settingStores[category]) Settings.makeStore(category);
goosemodScope.patcher.inject(id, SettingsView.prototype, 'getPredicateSections', (_, sections) => { goosemodScope.patcher.inject(id, SettingsView.prototype, 'getPredicateSections', (_, sections) => {
const logout = sections.find((c) => c.section === 'logout'); const logout = sections.find((c) => c.section === 'logout');
if (!logout) return sections; if (!logout) return sections;
@ -22,7 +24,7 @@ export const registerSettings = (id, { label, render, category }) => {
element: () => React.createElement(FormSection, { }, element: () => React.createElement(FormSection, { },
React.createElement(FormTitle, { tag: 'h2' }, finalLabel), React.createElement(FormTitle, { tag: 'h2' }, finalLabel),
render({ React.createElement(render, {
...Settings.settingStores[category] ...Settings.settingStores[category]
}) })
) )