diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/core/plugins/plugin.service.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index 525740a01..af330c2eb 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts | |||
@@ -125,8 +125,15 @@ export class PluginService { | |||
125 | 125 | ||
126 | for (const hook of this.hooks[hookName]) { | 126 | for (const hook of this.hooks[hookName]) { |
127 | try { | 127 | try { |
128 | if (wait) result = await hook.handler(param) | 128 | const p = hook.handler(param) |
129 | else result = hook.handler() | 129 | |
130 | if (wait) { | ||
131 | result = await p | ||
132 | } else if (p.catch) { | ||
133 | p.catch((err: Error) => { | ||
134 | console.error('Cannot run hook %s of script %s of plugin %s.', hookName, hook.plugin, hook.clientScript, err) | ||
135 | }) | ||
136 | } | ||
130 | } catch (err) { | 137 | } catch (err) { |
131 | console.error('Cannot run hook %s of script %s of plugin %s.', hookName, hook.plugin, hook.clientScript, err) | 138 | console.error('Cannot run hook %s of script %s of plugin %s.', hookName, hook.plugin, hook.clientScript, err) |
132 | } | 139 | } |