mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-18 02:47:03 -04:00
Settings API: add support for custom objects / arrays (#3154)
This commit is contained in:
parent
317121fc08
commit
5c8ba6e542
13 changed files with 420 additions and 355 deletions
|
@ -25,7 +25,7 @@ import { addMessageAccessory, removeMessageAccessory } from "@api/MessageAccesso
|
|||
import { addMessageDecoration, removeMessageDecoration } from "@api/MessageDecorations";
|
||||
import { addMessageClickListener, addMessagePreEditListener, addMessagePreSendListener, removeMessageClickListener, removeMessagePreEditListener, removeMessagePreSendListener } from "@api/MessageEvents";
|
||||
import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
|
||||
import { Settings } from "@api/Settings";
|
||||
import { Settings, SettingsStore } from "@api/Settings";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { canonicalizeFind } from "@utils/patches";
|
||||
import { Patch, Plugin, PluginDef, ReporterTestable, StartAt } from "@utils/types";
|
||||
|
@ -146,6 +146,10 @@ for (const p of pluginsValues) {
|
|||
for (const [name, def] of Object.entries(p.settings.def)) {
|
||||
const checks = p.settings.checks?.[name];
|
||||
p.options[name] = { ...def, ...checks };
|
||||
|
||||
if (def.onChange != null) {
|
||||
SettingsStore.addChangeListener(`plugins.${p.name}.${name}`, def.onChange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue