]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/videos/recommendations/recommended-videos.component.ts
Add federation to ownership change
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / recommendations / recommended-videos.component.ts
CommitLineData
7f5f4152
BJ
1import { Component, Input, OnChanges } from '@angular/core'
2import { Observable } from 'rxjs'
3import { Video } from '@app/shared/video/video.model'
4import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store'
5import { User } from '@app/shared'
6
7@Component({
8 selector: 'my-recommended-videos',
9 templateUrl: './recommended-videos.component.html'
10})
11export class RecommendedVideosComponent implements OnChanges {
12 @Input() inputVideo: Video
13 @Input() user: User
14
15 readonly hasVideos$: Observable<boolean>
16 readonly videos$: Observable<Video[]>
17
18 constructor (
19 private store: RecommendedVideosStore
20 ) {
21 this.videos$ = this.store.recommendations$
22 this.hasVideos$ = this.store.hasRecommendations$
23 }
24
25 public ngOnChanges (): void {
26 if (this.inputVideo) {
27 this.store.requestNewRecommendations(this.inputVideo.uuid)
28 }
29 }
30
31}