X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Fplugins%2Fplugin.service.ts;h=e24468da553f12c653ad6b2a6fa9270df8934355;hb=5dfb7c1dec8222b0bbccac5b56ad46da1438747e;hp=3af36765af795ed8de83fbac93b4ccd25add3242;hpb=5c5e587307a27e173333789b5b5167d35f468b01;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 3af36765a..e24468da5 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 } from '@app/core/auth' import { RestExtractor } from '@app/shared/rest' import { PluginType } from '@shared/models/plugins/plugin.type' import { PublicServerSetting } from '@shared/models/plugins/public-server.setting' @@ -42,7 +43,8 @@ export class PluginService implements ClientHook { pluginsLoaded: { [ scope in PluginClientScope ]: ReplaySubject } = { common: new ReplaySubject(1), search: new ReplaySubject(1), - 'video-watch': new ReplaySubject(1) + 'video-watch': new ReplaySubject(1), + signup: new ReplaySubject(1) } translationsObservable: Observable @@ -57,6 +59,7 @@ export class PluginService implements ClientHook { constructor ( private router: Router, + private authService: AuthService, private server: ServerService, private zone: NgZone, private authHttp: HttpClient, @@ -265,6 +268,10 @@ export class PluginService implements ClientHook { .toPromise() }, + isLoggedIn: () => { + return this.authService.isLoggedIn() + }, + translate: (value: string) => { return this.translationsObservable .pipe(map(allTranslations => allTranslations[npmName]))