X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Fplugins%2Fplugin.service.ts;h=b9d55a7e49ef7fb3c5bd4786f3d2547030c298ba;hb=74c2dece42d387506421623fbfadc83da811ebcd;hp=3f96ef6de72bf79ca147ccc4429aacd9752c6219;hpb=63472d88d1a319405752873dfc8d809d28cde583;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index 3f96ef6de..b9d55a7e4 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts @@ -12,7 +12,7 @@ import { ClientHook, ClientHookName, clientHookObject } from '@shared/models/plu import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type' import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model' import { HttpClient } from '@angular/common/http' -import { AuthService } from '@app/core' +import { AuthService, Notifier } from '@app/core' import { RestExtractor } from '@app/shared/rest' import { PluginType } from '@shared/models/plugins/plugin.type' import { PublicServerSetting } from '@shared/models/plugins/public-server.setting' @@ -60,6 +60,7 @@ export class PluginService implements ClientHook { constructor ( private router: Router, private authService: AuthService, + private notifier: Notifier, private server: ServerService, private zone: NgZone, private authHttp: HttpClient, @@ -70,9 +71,9 @@ export class PluginService implements ClientHook { } initializePlugins () { - this.server.configLoaded - .subscribe(() => { - this.plugins = this.server.getConfig().plugin.registered + this.server.getConfig() + .subscribe(config => { + this.plugins = config.plugin.registered this.buildScopeStruct() @@ -272,6 +273,8 @@ export class PluginService implements ClientHook { return this.authService.isLoggedIn() }, + notifier: this.notifier, + translate: (value: string) => { return this.translationsObservable .pipe(map(allTranslations => allTranslations[npmName]))