X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Fplugins%2Fhooks.service.ts;h=29db75d89bea8b7d24ddb073d517cdb4bee4fc6f;hb=2c8380a46f34631e705b1564938343cacfa4b0bc;hp=7fd56d92e833a980eb3177fb2b59507eb0f6b536;hpb=42b40636991b97fe818007fab19091764fc5db73;p=github%2FChocobozzz%2FPeerTube.git 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) {