diff options
Diffstat (limited to 'client/src/app/core/plugins/plugin.service.ts')
-rw-r--r-- | client/src/app/core/plugins/plugin.service.ts | 7 |
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' | |||
8 | import { ReplaySubject } from 'rxjs' | 8 | import { ReplaySubject } from 'rxjs' |
9 | import { first, shareReplay } from 'rxjs/operators' | 9 | import { first, shareReplay } from 'rxjs/operators' |
10 | import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks' | 10 | import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks' |
11 | import { ClientHook, ClientHookName } from '@shared/models/plugins/client-hook.model' | 11 | import { ClientHook, ClientHookName, clientHookObject } from '@shared/models/plugins/client-hook.model' |
12 | import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type' | 12 | import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type' |
13 | 13 | ||
14 | interface HookStructValue extends RegisterHookOptions { | 14 | interface 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({ |