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/shared/video/video-miniature.component.ts | |
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/shared/video/video-miniature.component.ts')
-rw-r--r-- | client/src/app/shared/video/video-miniature.component.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/app/shared/video/video-miniature.component.ts b/client/src/app/shared/video/video-miniature.component.ts index d5c7dfd9b..9fffc7ddb 100644 --- a/client/src/app/shared/video/video-miniature.component.ts +++ b/client/src/app/shared/video/video-miniature.component.ts | |||
@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, LOCALE | |||
2 | import { User } from '../users' | 2 | import { User } from '../users' |
3 | import { Video } from './video.model' | 3 | import { Video } from './video.model' |
4 | import { ServerService } from '@app/core' | 4 | import { ServerService } from '@app/core' |
5 | import { VideoPrivacy, VideoState } from '../../../../../shared' | 5 | import { ServerConfig, VideoPrivacy, VideoState } from '../../../../../shared' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { VideoActionsDisplayType } from '@app/shared/video/video-actions-dropdown.component' | 7 | import { VideoActionsDisplayType } from '@app/shared/video/video-actions-dropdown.component' |
8 | import { ScreenService } from '@app/shared/misc/screen.service' | 8 | import { ScreenService } from '@app/shared/misc/screen.service' |
@@ -55,6 +55,7 @@ export class VideoMiniatureComponent implements OnInit { | |||
55 | report: true | 55 | report: true |
56 | } | 56 | } |
57 | showActions = false | 57 | showActions = false |
58 | serverConfig: ServerConfig | ||
58 | 59 | ||
59 | private ownerDisplayTypeChosen: 'account' | 'videoChannel' | 60 | private ownerDisplayTypeChosen: 'account' | 'videoChannel' |
60 | 61 | ||
@@ -66,10 +67,14 @@ export class VideoMiniatureComponent implements OnInit { | |||
66 | ) { } | 67 | ) { } |
67 | 68 | ||
68 | get isVideoBlur () { | 69 | get isVideoBlur () { |
69 | return this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig()) | 70 | return this.video.isVideoNSFWForUser(this.user, this.serverConfig) |
70 | } | 71 | } |
71 | 72 | ||
72 | ngOnInit () { | 73 | ngOnInit () { |
74 | this.serverConfig = this.serverService.getTmpConfig() | ||
75 | this.serverService.getConfig() | ||
76 | .subscribe(config => this.serverConfig = config) | ||
77 | |||
73 | this.setUpBy() | 78 | this.setUpBy() |
74 | 79 | ||
75 | // We rely on mouseenter to lazy load actions | 80 | // We rely on mouseenter to lazy load actions |