diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-17 15:46:51 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0 (patch) | |
tree | 7a107a1abfc474e7590d3e64fac4b5b01c12c7f4 /client | |
parent | 662e5d4fe4b0ac61867f3f4fa3bb38a8b8e5d0f5 (diff) | |
download | PeerTube-9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0.tar.gz PeerTube-9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0.tar.zst PeerTube-9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0.zip |
Some plugins fixes and doc enhancements
Diffstat (limited to 'client')
-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 | } |