aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/plugins
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-03 10:39:40 +0200
committerChocobozzz <me@florianbigard.com>2022-08-03 10:39:40 +0200
commit9ca0f688e9e8558233f1a538b96a43da44e35353 (patch)
tree16370ffe97df1bfeef874ce71fa6bedff0b7496b /client/src/app/core/plugins
parent0b6f531653a7a24f82ad65564479a70a9326301a (diff)
downloadPeerTube-9ca0f688e9e8558233f1a538b96a43da44e35353.tar.gz
PeerTube-9ca0f688e9e8558233f1a538b96a43da44e35353.tar.zst
PeerTube-9ca0f688e9e8558233f1a538b96a43da44e35353.zip
Add channel hooks
Diffstat (limited to 'client/src/app/core/plugins')
-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) {