Add onMasterConfigFieldChanged hook

Add hook for master plugin code to react to the master config changing.
This commit is contained in:
Hornwitser committed 2022-02-10 10:29:47 +01:00
1 parent a979c0cfac
commit 68b8ac6b8c
3 files changed
+18

No files matched your search

+3
View File
@@ -162,6 +162,9 @@ class Master {
this.userManager = new UserManager(this.config);
await this.userManager.load(path.join(databaseDirectory, "users.json"));
this.config.on("fieldChanged", (group, field, prev) => {
libPlugin.invokeHook(this.plugins, "onMasterConfigFieldChanged", group, field, prev);
});
for (let instance of this.instances.values()) {
this.addInstanceHooks(instance);
}