From 9ca0f688e9e8558233f1a538b96a43da44e35353 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Aug 2022 10:39:40 +0200 Subject: Add channel hooks --- client/src/app/core/plugins/hooks.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'client/src/app/core') diff --git a/client/src/app/core/plugins/hooks.service.ts b/client/src/app/core/plugins/hooks.service.ts index 7fd56d92e..29db75d89 100644 --- a/client/src/app/core/plugins/hooks.service.ts +++ b/client/src/app/core/plugins/hooks.service.ts @@ -49,9 +49,12 @@ export class HooksService { } runAction (hookName: U, scope: PluginClientScope, params?: T) { - this.pluginService.ensurePluginsAreLoaded(scope) + // Use setTimeout to give priority to Angular change detector + setTimeout(() => { + this.pluginService.ensurePluginsAreLoaded(scope) .then(() => this.pluginService.runHook(hookName, undefined, params)) .catch((err: any) => logger.error('Fatal hook error.', err)) + }) } async wrapObject (result: T, scope: PluginClientScope, hookName: U) { -- cgit v1.2.3