ActivityPub-federated video streaming platform using P2P directly in your web browser
Handle hook with Promise as result
Chocobozzz2e5dd0bef879
diff --git a/client/src/root-helpers/plugins-manager.ts b/client/src/root-helpers/plugins-manager.tsindex 6c64e2b014..31510d4e64 100644--- a/client/src/root-helpers/plugins-manager.ts+++ b/client/src/root-helpers/plugins-manager.ts@@ -105,11 +105,16 @@ class PluginsManager {}}- async runHook<T> (hookName: ClientHookName, result?: T, params?: any) {- if (!this.hooks[hookName]) return result+ async runHook<T> (hookName: ClientHookName, resultArg?: T | Promise<T>, params?: any) {+ if (!this.hooks[hookName]) {+ // eslint-disable-next-line no-return-await+ return await resultArg+ }const hookType = getHookType(hookName)+ let result = await resultArg+for (const hook of this.hooks[hookName]) {logger.info(`Running hook ${hookName} of plugin ${hook.plugin.name}`)