diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-12 17:26:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-16 16:41:36 +0200 |
commit | af5767ffae41b2d5604e41ba9a7225c623dd6735 (patch) | |
tree | b96787bd134fe04d3d042795636df4bf17b5991f /client/src/app/+my-account/my-account.component.ts | |
parent | 7ad9b9846c44d198a736183fb186c2039f5236b5 (diff) | |
download | PeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.tar.gz PeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.tar.zst PeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.zip |
Add user/instance block by users in the client
Diffstat (limited to 'client/src/app/+my-account/my-account.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account.component.ts | 15 |
1 files changed, 12 insertions, 3 deletions
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' | |||
13 | export class MyAccountComponent implements OnInit, OnDestroy { | 13 | export class MyAccountComponent implements OnInit, OnDestroy { |
14 | 14 | ||
15 | libraryLabel = '' | 15 | libraryLabel = '' |
16 | miscLabel = '' | ||
16 | 17 | ||
17 | private routeSub: Subscription | 18 | private routeSub: Subscription |
18 | 19 | ||
@@ -23,11 +24,11 @@ export class MyAccountComponent implements OnInit, OnDestroy { | |||
23 | ) {} | 24 | ) {} |
24 | 25 | ||
25 | ngOnInit () { | 26 | ngOnInit () { |
26 | this.updateLibraryLabel(this.router.url) | 27 | this.updateLabels(this.router.url) |
27 | 28 | ||
28 | this.routeSub = this.router.events | 29 | this.routeSub = this.router.events |
29 | .pipe(filter(event => event instanceof NavigationStart)) | 30 | .pipe(filter(event => event instanceof NavigationStart)) |
30 | .subscribe((event: NavigationStart) => this.updateLibraryLabel(event.url)) | 31 | .subscribe((event: NavigationStart) => this.updateLabels(event.url)) |
31 | } | 32 | } |
32 | 33 | ||
33 | ngOnDestroy () { | 34 | ngOnDestroy () { |
@@ -40,7 +41,7 @@ export class MyAccountComponent implements OnInit, OnDestroy { | |||
40 | return importConfig.http.enabled || importConfig.torrent.enabled | 41 | return importConfig.http.enabled || importConfig.torrent.enabled |
41 | } | 42 | } |
42 | 43 | ||
43 | private updateLibraryLabel (url: string) { | 44 | private updateLabels (url: string) { |
44 | const [ path ] = url.split('?') | 45 | const [ path ] = url.split('?') |
45 | 46 | ||
46 | if (path.startsWith('/my-account/video-channels')) { | 47 | if (path.startsWith('/my-account/video-channels')) { |
@@ -54,5 +55,13 @@ export class MyAccountComponent implements OnInit, OnDestroy { | |||
54 | } else { | 55 | } else { |
55 | this.libraryLabel = '' | 56 | this.libraryLabel = '' |
56 | } | 57 | } |
58 | |||
59 | if (path.startsWith('/my-account/blocklist/accounts')) { | ||
60 | this.miscLabel = this.i18n('Muted accounts') | ||
61 | } else if (path.startsWith('/my-account/blocklist/servers')) { | ||
62 | this.miscLabel = this.i18n('Muted instances') | ||
63 | } else { | ||
64 | this.miscLabel = '' | ||
65 | } | ||
57 | } | 66 | } |
58 | } | 67 | } |