aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-01-24 13:43:25 +0100
committerChocobozzz <me@florianbigard.com>2023-01-24 13:43:25 +0100
commit3a380e9a71037b0fcbace58a7599221e7cc76e20 (patch)
tree9d16193a5e02334cde96099b4ef7a3bb0fb0f3ae /client/src/root-helpers
parent389eb034efc099ea1cbfe5d00912bb6fe8a2d78f (diff)
parent2e5dd0bef8797dad82e5a908c30bc126cb924033 (diff)
downloadPeerTube-3a380e9a71037b0fcbace58a7599221e7cc76e20.tar.gz
PeerTube-3a380e9a71037b0fcbace58a7599221e7cc76e20.tar.zst
PeerTube-3a380e9a71037b0fcbace58a7599221e7cc76e20.zip
Merge branch 'release/5.0.0' into develop
Diffstat (limited to 'client/src/root-helpers')
-rw-r--r--client/src/root-helpers/plugins-manager.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/root-helpers/plugins-manager.ts b/client/src/root-helpers/plugins-manager.ts
index e5b06a94c..f3416e44a 100644
--- a/client/src/root-helpers/plugins-manager.ts
+++ b/client/src/root-helpers/plugins-manager.ts
@@ -108,11 +108,16 @@ class PluginsManager {
108 } 108 }
109 } 109 }
110 110
111 async runHook<T> (hookName: ClientHookName, result?: T, params?: any) { 111 async runHook<T> (hookName: ClientHookName, resultArg?: T | Promise<T>, params?: any) {
112 if (!this.hooks[hookName]) return result 112 if (!this.hooks[hookName]) {
113 // eslint-disable-next-line no-return-await
114 return await resultArg
115 }
113 116
114 const hookType = getHookType(hookName) 117 const hookType = getHookType(hookName)
115 118
119 let result = await resultArg
120
116 for (const hook of this.hooks[hookName]) { 121 for (const hook of this.hooks[hookName]) {
117 logger.info(`Running hook ${hookName} of plugin ${hook.plugin.name}`) 122 logger.info(`Running hook ${hookName} of plugin ${hook.plugin.name}`)
118 123