]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/plugins/hooks.service.ts
Fix bad import on FF ESR
[github/Chocobozzz/PeerTube.git] / client / src / app / core / plugins / hooks.service.ts
index 80c57869c0008a507e69aaf861b5095e371b31b8..93dac1167cdecb8d6ee009089a8b5ea99c0652a8 100644 (file)
@@ -37,8 +37,9 @@ export class HooksService {
     return this.pluginService.runHook(hookName, result, params)
   }
 
-  runAction<T, U extends ClientActionHookName> (hookName: U, params?: T) {
-    this.pluginService.runHook(hookName, params)
-                 .catch((err: any) => console.error('Fatal hook error.', { err }))
+  runAction<T, U extends ClientActionHookName> (hookName: U, scope: PluginClientScope, params?: T) {
+    this.pluginService.ensurePluginsAreLoaded(scope)
+        .then(() => this.pluginService.runHook(hookName, undefined, params))
+        .catch((err: any) => console.error('Fatal hook error.', { err }))
   }
 }