aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/plugins/hooks.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-23 12:16:34 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commitc9e3eeedad67649d9b7aec8897b738d0ad63ec1f (patch)
tree97590f0e9d4c16c0968ba6f6ff1b1d12672f999b /client/src/app/core/plugins/hooks.service.ts
parent5b77537ce54832f47931ba47dc513be2a9197f92 (diff)
downloadPeerTube-c9e3eeedad67649d9b7aec8897b738d0ad63ec1f.tar.gz
PeerTube-c9e3eeedad67649d9b7aec8897b738d0ad63ec1f.tar.zst
PeerTube-c9e3eeedad67649d9b7aec8897b738d0ad63ec1f.zip
Lazy load client script scopes
Diffstat (limited to 'client/src/app/core/plugins/hooks.service.ts')
-rw-r--r--client/src/app/core/plugins/hooks.service.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/core/plugins/hooks.service.ts b/client/src/app/core/plugins/hooks.service.ts
index 80c57869c..257e27e6b 100644
--- a/client/src/app/core/plugins/hooks.service.ts
+++ b/client/src/app/core/plugins/hooks.service.ts
@@ -37,8 +37,9 @@ export class HooksService {
37 return this.pluginService.runHook(hookName, result, params) 37 return this.pluginService.runHook(hookName, result, params)
38 } 38 }
39 39
40 runAction<T, U extends ClientActionHookName> (hookName: U, params?: T) { 40 runAction<T, U extends ClientActionHookName> (hookName: U, scope: PluginClientScope, params?: T) {
41 this.pluginService.runHook(hookName, params) 41 this.pluginService.ensurePluginsAreLoaded(scope)
42 .catch((err: any) => console.error('Fatal hook error.', { err })) 42 .then(() => this.pluginService.runHook(hookName, params))
43 .catch((err: any) => console.error('Fatal hook error.', { err }))
43 } 44 }
44} 45}