]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/plugins/hooks.service.ts
Fix confirm modal containing 2 inputs
[github/Chocobozzz/PeerTube.git] / client / src / app / core / plugins / hooks.service.ts
index 7fd56d92e833a980eb3177fb2b59507eb0f6b536..29db75d89bea8b7d24ddb073d517cdb4bee4fc6f 100644 (file)
@@ -49,9 +49,12 @@ export class HooksService {
   }
 
   runAction<T, U extends ClientActionHookName> (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<T, U extends ClientFilterHookName> (result: T, scope: PluginClientScope, hookName: U) {