[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
1 changed files with 3 additions and 1 deletions

View File

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