From af5767ffae41b2d5604e41ba9a7225c623dd6735 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 12 Oct 2018 17:26:40 +0200 Subject: Add user/instance block by users in the client --- client/src/app/+my-account/my-account.component.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'client/src/app/+my-account/my-account.component.ts') diff --git a/client/src/app/+my-account/my-account.component.ts b/client/src/app/+my-account/my-account.component.ts index bad60a8fb..d728caf07 100644 --- a/client/src/app/+my-account/my-account.component.ts +++ b/client/src/app/+my-account/my-account.component.ts @@ -13,6 +13,7 @@ import { Subscription } from 'rxjs' export class MyAccountComponent implements OnInit, OnDestroy { libraryLabel = '' + miscLabel = '' private routeSub: Subscription @@ -23,11 +24,11 @@ export class MyAccountComponent implements OnInit, OnDestroy { ) {} ngOnInit () { - this.updateLibraryLabel(this.router.url) + this.updateLabels(this.router.url) this.routeSub = this.router.events .pipe(filter(event => event instanceof NavigationStart)) - .subscribe((event: NavigationStart) => this.updateLibraryLabel(event.url)) + .subscribe((event: NavigationStart) => this.updateLabels(event.url)) } ngOnDestroy () { @@ -40,7 +41,7 @@ export class MyAccountComponent implements OnInit, OnDestroy { return importConfig.http.enabled || importConfig.torrent.enabled } - private updateLibraryLabel (url: string) { + private updateLabels (url: string) { const [ path ] = url.split('?') if (path.startsWith('/my-account/video-channels')) { @@ -54,5 +55,13 @@ export class MyAccountComponent implements OnInit, OnDestroy { } else { this.libraryLabel = '' } + + if (path.startsWith('/my-account/blocklist/accounts')) { + this.miscLabel = this.i18n('Muted accounts') + } else if (path.startsWith('/my-account/blocklist/servers')) { + this.miscLabel = this.i18n('Muted instances') + } else { + this.miscLabel = '' + } } } -- cgit v1.2.3