Emit config:loaded event

pull/1017/head
Zef Hemel 2024-08-03 20:59:53 +02:00
parent 49f52e42d0
commit ea6e4ce079
3 changed files with 3 additions and 2 deletions

View File

@ -97,8 +97,7 @@ async function loadConfigsFromSystem(
fullConfig = deepObjectMerge(fullConfig, { [config.key]: config.value }); fullConfig = deepObjectMerge(fullConfig, { [config.key]: config.value });
} }
// And clean up the JSON (expand .-separated paths, convert dates to strings) // And clean up the JSON (expand .-separated paths, convert dates to strings)
fullConfig = cleanupJSON(fullConfig); return cleanupJSON(fullConfig);
return fullConfig;
} }
/** /**

View File

@ -149,6 +149,7 @@ export class SpaceServer implements ConfigContainer {
if (this.serverSystem) { if (this.serverSystem) {
updateObjectDecorators(this.config, this.serverSystem.ds); updateObjectDecorators(this.config, this.serverSystem.ds);
this.serverSystem.eventHook.dispatchEvent("config:loaded", this.config);
} }
} }
} }

View File

@ -271,6 +271,7 @@ export class Client implements ConfigContainer {
this.clientSystem.slashCommandHook.buildAllCommands( this.clientSystem.slashCommandHook.buildAllCommands(
this.clientSystem.system, this.clientSystem.system,
); );
this.eventHook.dispatchEvent("config:loaded", this.config);
} }
private async initSync() { private async initSync() {