aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers/plugins-manager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/root-helpers/plugins-manager.ts')
-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 6c64e2b01..31510d4e6 100644
--- a/client/src/root-helpers/plugins-manager.ts
+++ b/client/src/root-helpers/plugins-manager.ts
@@ -105,11 +105,16 @@ class PluginsManager {
105 } 105 }
106 } 106 }
107 107
108 async runHook<T> (hookName: ClientHookName, result?: T, params?: any) { 108 async runHook<T> (hookName: ClientHookName, resultArg?: T | Promise<T>, params?: any) {
109 if (!this.hooks[hookName]) return result 109 if (!this.hooks[hookName]) {
110 // eslint-disable-next-line no-return-await
111 return await resultArg
112 }
110 113
111 const hookType = getHookType(hookName) 114 const hookType = getHookType(hookName)
112 115
116 let result = await resultArg
117
113 for (const hook of this.hooks[hookName]) { 118 for (const hook of this.hooks[hookName]) {
114 logger.info(`Running hook ${hookName} of plugin ${hook.plugin.name}`) 119 logger.info(`Running hook ${hookName} of plugin ${hook.plugin.name}`)
115 120