X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Fplugins%2Fplugin.service.ts;h=b9d55a7e49ef7fb3c5bd4786f3d2547030c298ba;hb=74c2dece42d387506421623fbfadc83da811ebcd;hp=52ba4215ab380bfd39444ebc45c1b338d773c950;hpb=ba7b7e572f0634e534320a057f4cc0a95f2a541d;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 52ba4215a..b9d55a7e4 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts @@ -12,6 +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, 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' @@ -58,6 +59,8 @@ export class PluginService implements ClientHook { constructor ( private router: Router, + private authService: AuthService, + private notifier: Notifier, private server: ServerService, private zone: NgZone, private authHttp: HttpClient, @@ -68,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() @@ -266,6 +269,12 @@ export class PluginService implements ClientHook { .toPromise() }, + isLoggedIn: () => { + return this.authService.isLoggedIn() + }, + + notifier: this.notifier, + translate: (value: string) => { return this.translationsObservable .pipe(map(allTranslations => allTranslations[npmName]))