diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/root-helpers/plugins-manager.ts | 9 |
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 | ||