diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-29 16:16:12 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-29 16:16:12 +0200 |
commit | 0ca454e3bdf89390d1a48760ab555ddd8725c82d (patch) | |
tree | ec648012f0deb674704732894bd895b336c91b0c /client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts | |
parent | 76b8d72e324d3a148beec38ed7b36ccfd5eb4009 (diff) | |
download | PeerTube-0ca454e3bdf89390d1a48760ab555ddd8725c82d.tar.gz PeerTube-0ca454e3bdf89390d1a48760ab555ddd8725c82d.tar.zst PeerTube-0ca454e3bdf89390d1a48760ab555ddd8725c82d.zip |
Only display homepage when components are loaded
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts')
-rw-r--r-- | client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts index d4402dd9f..02738022e 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts | |||
@@ -1,8 +1,9 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { AuthService } from '@app/core' | 2 | import { AuthService } from '@app/core' |
3 | import { VideoFilter, VideoSortField } from '@shared/models' | 3 | import { VideoFilter, VideoSortField } from '@shared/models' |
4 | import { Video, VideoService } from '../../shared-main' | 4 | import { Video, VideoService } from '../../shared-main' |
5 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' | 5 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' |
6 | import { CustomMarkupComponent } from './shared' | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * Markup component list videos depending on criterias | 9 | * Markup component list videos depending on criterias |
@@ -13,7 +14,7 @@ import { MiniatureDisplayOptions } from '../../shared-video-miniature' | |||
13 | templateUrl: 'videos-list-markup.component.html', | 14 | templateUrl: 'videos-list-markup.component.html', |
14 | styleUrls: [ 'videos-list-markup.component.scss' ] | 15 | styleUrls: [ 'videos-list-markup.component.scss' ] |
15 | }) | 16 | }) |
16 | export class VideosListMarkupComponent implements OnInit { | 17 | export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit { |
17 | @Input() sort: string | 18 | @Input() sort: string |
18 | @Input() categoryOneOf: number[] | 19 | @Input() categoryOneOf: number[] |
19 | @Input() languageOneOf: string[] | 20 | @Input() languageOneOf: string[] |
@@ -22,6 +23,8 @@ export class VideosListMarkupComponent implements OnInit { | |||
22 | @Input() filter: VideoFilter | 23 | @Input() filter: VideoFilter |
23 | @Input() maxRows: number | 24 | @Input() maxRows: number |
24 | 25 | ||
26 | @Output() loaded = new EventEmitter<boolean>() | ||
27 | |||
25 | videos: Video[] | 28 | videos: Video[] |
26 | 29 | ||
27 | displayOptions: MiniatureDisplayOptions = { | 30 | displayOptions: MiniatureDisplayOptions = { |
@@ -73,6 +76,10 @@ export class VideosListMarkupComponent implements OnInit { | |||
73 | } | 76 | } |
74 | 77 | ||
75 | this.videoService.getVideos(options) | 78 | this.videoService.getVideos(options) |
76 | .subscribe(({ data }) => this.videos = data) | 79 | .subscribe({ |
80 | next: ({ data }) => this.videos = data, | ||
81 | |||
82 | complete: () => this.loaded.emit(true) | ||
83 | }) | ||
77 | } | 84 | } |
78 | } | 85 | } |