diff options
Diffstat (limited to 'client/src/app/videos/video-list/video-overview.component.ts')
-rw-r--r-- | client/src/app/videos/video-list/video-overview.component.ts | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/client/src/app/videos/video-list/video-overview.component.ts b/client/src/app/videos/video-list/video-overview.component.ts index 101073949..8ff8400db 100644 --- a/client/src/app/videos/video-list/video-overview.component.ts +++ b/client/src/app/videos/video-list/video-overview.component.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { Subject } from 'rxjs' | ||
1 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
2 | import { AuthService, Notifier } from '@app/core' | 3 | import { Notifier } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { User, UserService } from '@app/shared' |
4 | import { VideosOverview } from '@app/shared/overview/videos-overview.model' | 5 | import { ScreenService } from '@app/shared/misc/screen.service' |
5 | import { OverviewService } from '@app/shared/overview' | 6 | import { OverviewService } from '@app/shared/overview' |
7 | import { VideosOverview } from '@app/shared/overview/videos-overview.model' | ||
6 | import { Video } from '@app/shared/video/video.model' | 8 | import { Video } from '@app/shared/video/video.model' |
7 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
8 | import { Subject } from 'rxjs' | ||
9 | 9 | ||
10 | @Component({ | 10 | @Component({ |
11 | selector: 'my-video-overview', | 11 | selector: 'my-video-overview', |
@@ -18,6 +18,8 @@ export class VideoOverviewComponent implements OnInit { | |||
18 | overviews: VideosOverview[] = [] | 18 | overviews: VideosOverview[] = [] |
19 | notResults = false | 19 | notResults = false |
20 | 20 | ||
21 | userMiniature: User | ||
22 | |||
21 | private loaded = false | 23 | private loaded = false |
22 | private currentPage = 1 | 24 | private currentPage = 1 |
23 | private maxPage = 20 | 25 | private maxPage = 20 |
@@ -25,19 +27,20 @@ export class VideoOverviewComponent implements OnInit { | |||
25 | private isLoading = false | 27 | private isLoading = false |
26 | 28 | ||
27 | constructor ( | 29 | constructor ( |
28 | private i18n: I18n, | ||
29 | private notifier: Notifier, | 30 | private notifier: Notifier, |
30 | private authService: AuthService, | 31 | private userService: UserService, |
31 | private overviewService: OverviewService, | 32 | private overviewService: OverviewService, |
32 | private screenService: ScreenService | 33 | private screenService: ScreenService |
33 | ) { } | 34 | ) { } |
34 | 35 | ||
35 | get user () { | ||
36 | return this.authService.getUser() | ||
37 | } | ||
38 | |||
39 | ngOnInit () { | 36 | ngOnInit () { |
40 | this.loadMoreResults() | 37 | this.loadMoreResults() |
38 | |||
39 | this.userService.getAnonymousOrLoggedUser() | ||
40 | .subscribe(user => this.userMiniature = user) | ||
41 | |||
42 | this.userService.listenAnonymousUpdate() | ||
43 | .subscribe(user => this.userMiniature = user) | ||
41 | } | 44 | } |
42 | 45 | ||
43 | buildVideoChannelBy (object: { videos: Video[] }) { | 46 | buildVideoChannelBy (object: { videos: Video[] }) { |