aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/plugins/hooks.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/plugins/hooks.service.ts')
-rw-r--r--client/src/app/core/plugins/hooks.service.ts5
1 files changed, 4 insertions, 1 deletions
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 {
49 } 49 }
50 50
51 runAction<T, U extends ClientActionHookName> (hookName: U, scope: PluginClientScope, params?: T) { 51 runAction<T, U extends ClientActionHookName> (hookName: U, scope: PluginClientScope, params?: T) {
52 this.pluginService.ensurePluginsAreLoaded(scope) 52 // Use setTimeout to give priority to Angular change detector
53 setTimeout(() => {
54 this.pluginService.ensurePluginsAreLoaded(scope)
53 .then(() => this.pluginService.runHook(hookName, undefined, params)) 55 .then(() => this.pluginService.runHook(hookName, undefined, params))
54 .catch((err: any) => logger.error('Fatal hook error.', err)) 56 .catch((err: any) => logger.error('Fatal hook error.', err))
57 })
55 } 58 }
56 59
57 async wrapObject<T, U extends ClientFilterHookName> (result: T, scope: PluginClientScope, hookName: U) { 60 async wrapObject<T, U extends ClientFilterHookName> (result: T, scope: PluginClientScope, hookName: U) {