diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-18 15:31:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-18 15:40:59 +0100 |
commit | ba430d7516bc5b1324b60571ba7594460969b7fb (patch) | |
tree | df5c6952c82f49a94c0a884bbc97d4a0cbd9f867 /client/src/app/+admin/moderation | |
parent | 5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff) | |
download | PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip |
Lazy load static objects
Diffstat (limited to 'client/src/app/+admin/moderation')
-rw-r--r-- | client/src/app/+admin/moderation/moderation.component.ts | 14 | ||||
-rw-r--r-- | client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts | 19 |
2 files changed, 20 insertions, 13 deletions
diff --git a/client/src/app/+admin/moderation/moderation.component.ts b/client/src/app/+admin/moderation/moderation.component.ts index 47154af3f..7744deb06 100644 --- a/client/src/app/+admin/moderation/moderation.component.ts +++ b/client/src/app/+admin/moderation/moderation.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { UserRight } from '../../../../../shared' | 2 | import { UserRight } from '../../../../../shared' |
3 | import { AuthService, ServerService } from '@app/core' | 3 | import { AuthService, ServerService } from '@app/core' |
4 | 4 | ||
@@ -6,14 +6,18 @@ import { AuthService, ServerService } from '@app/core' | |||
6 | templateUrl: './moderation.component.html', | 6 | templateUrl: './moderation.component.html', |
7 | styleUrls: [ './moderation.component.scss' ] | 7 | styleUrls: [ './moderation.component.scss' ] |
8 | }) | 8 | }) |
9 | export class ModerationComponent { | 9 | export class ModerationComponent implements OnInit { |
10 | autoBlacklistVideosEnabled: boolean | 10 | autoBlacklistVideosEnabled = false |
11 | 11 | ||
12 | constructor ( | 12 | constructor ( |
13 | private auth: AuthService, | 13 | private auth: AuthService, |
14 | private serverService: ServerService | 14 | private serverService: ServerService |
15 | ) { | 15 | ) { } |
16 | this.autoBlacklistVideosEnabled = this.serverService.getConfig().autoBlacklist.videos.ofUsers.enabled | 16 | |
17 | ngOnInit (): void { | ||
18 | this.serverService.getConfig() | ||
19 | .subscribe(config => this.autoBlacklistVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled) | ||
20 | |||
17 | } | 21 | } |
18 | 22 | ||
19 | hasVideoAbusesRight () { | 23 | hasVideoAbusesRight () { |
diff --git a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts index f4bce7c48..5876f658b 100644 --- a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts +++ b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts | |||
@@ -33,11 +33,18 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit { | |||
33 | private i18n: I18n | 33 | private i18n: I18n |
34 | ) { | 34 | ) { |
35 | super() | 35 | super() |
36 | } | ||
36 | 37 | ||
37 | // don't filter if auto-blacklist not enabled as this will be only list | 38 | ngOnInit () { |
38 | if (this.serverService.getConfig().autoBlacklist.videos.ofUsers.enabled) { | 39 | this.serverService.getConfig() |
39 | this.listBlacklistTypeFilter = VideoBlacklistType.MANUAL | 40 | .subscribe(config => { |
40 | } | 41 | // don't filter if auto-blacklist not enabled as this will be only list |
42 | if (config.autoBlacklist.videos.ofUsers.enabled) { | ||
43 | this.listBlacklistTypeFilter = VideoBlacklistType.MANUAL | ||
44 | } | ||
45 | }) | ||
46 | |||
47 | this.initialize() | ||
41 | 48 | ||
42 | this.videoBlacklistActions = [ | 49 | this.videoBlacklistActions = [ |
43 | { | 50 | { |
@@ -47,10 +54,6 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit { | |||
47 | ] | 54 | ] |
48 | } | 55 | } |
49 | 56 | ||
50 | ngOnInit () { | ||
51 | this.initialize() | ||
52 | } | ||
53 | |||
54 | getVideoUrl (videoBlacklist: VideoBlacklist) { | 57 | getVideoUrl (videoBlacklist: VideoBlacklist) { |
55 | return Video.buildClientUrl(videoBlacklist.video.uuid) | 58 | return Video.buildClientUrl(videoBlacklist.video.uuid) |
56 | } | 59 | } |