[Settings] Use new Patcher API for Settings injection

pull/36/head
Oj18 3 years ago
parent 78e870be7c
commit 3fe4e9a17c

@ -24,6 +24,7 @@
- ### Backend Improvements
- Using new Module Store API
- Use new Patcher API for Settings injection
- ### Fixes
- Made custom version info in settings more precise and should no longer crash if also using Powercord's BDCompat when opening settings

@ -142,7 +142,7 @@ const init = async function () {
this.saveInterval = setInterval(this.saveModuleSettings, 3000);
this.remove = () => {
this.patcher.uninject('gm-settings');
this.settingsUninject();
clearInterval(this.messageEasterEggs.interval);
clearInterval(this.saveInterval);

@ -1486,7 +1486,7 @@ export const makeGooseModSettings = () => {
const SettingsView = goosemodScope.webpackModules.findByDisplayName('SettingsView');
const { React } = goosemodScope.webpackModules.common;
goosemodScope.patcher.inject('gm-settings', SettingsView.prototype, 'getPredicateSections', (_, sections) => {
goosemodScope.settingsUninject = goosemodScope.patcher.patch(SettingsView.prototype, 'getPredicateSections', (_, sections) => {
if (!sections.find(c => c.section === 'changelog')) return sections;
const dividers = sections.filter(c => c.section === 'DIVIDER');

Loading…
Cancel
Save