aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/plugins/plugin.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/plugins/plugin.service.ts')
-rw-r--r--client/src/app/core/plugins/plugin.service.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts
index 7c1d69bec..90ebe5669 100644
--- a/client/src/app/core/plugins/plugin.service.ts
+++ b/client/src/app/core/plugins/plugin.service.ts
@@ -8,7 +8,7 @@ import { RegisterHookOptions } from '@shared/models/plugins/register-hook.model'
8import { ReplaySubject } from 'rxjs' 8import { ReplaySubject } from 'rxjs'
9import { first, shareReplay } from 'rxjs/operators' 9import { first, shareReplay } from 'rxjs/operators'
10import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks' 10import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks'
11import { ClientHook, ClientHookName } from '@shared/models/plugins/client-hook.model' 11import { ClientHook, ClientHookName, clientHookObject } from '@shared/models/plugins/client-hook.model'
12import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type' 12import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type'
13 13
14interface HookStructValue extends RegisterHookOptions { 14interface HookStructValue extends RegisterHookOptions {
@@ -155,6 +155,11 @@ export class PluginService implements ClientHook {
155 const { plugin, clientScript } = pluginInfo 155 const { plugin, clientScript } = pluginInfo
156 156
157 const registerHook = (options: RegisterHookOptions) => { 157 const registerHook = (options: RegisterHookOptions) => {
158 if (clientHookObject[options.target] !== true) {
159 console.error('Unknown hook %s of plugin %s. Skipping.', options.target, plugin.name)
160 return
161 }
162
158 if (!this.hooks[options.target]) this.hooks[options.target] = [] 163 if (!this.hooks[options.target]) this.hooks[options.target] = []
159 164
160 this.hooks[options.target].push({ 165 this.hooks[options.target].push({