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/channel-miniature-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/channel-miniature-markup.component.ts')
-rw-r--r-- | client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts index 87caec8a5..a91debbef 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts | |||
@@ -1,8 +1,9 @@ | |||
1 | import { map, switchMap } from 'rxjs/operators' | 1 | import { map, switchMap } from 'rxjs/operators' |
2 | import { Component, Input, OnInit } from '@angular/core' | 2 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
3 | import { MarkdownService, UserService } from '@app/core' | 3 | import { MarkdownService, UserService } from '@app/core' |
4 | import { Video, VideoSortField } from '@shared/models/videos' | 4 | import { Video, VideoSortField } from '@shared/models/videos' |
5 | import { VideoChannel, VideoChannelService, VideoService } from '../../shared-main' | 5 | import { VideoChannel, VideoChannelService, VideoService } from '../../shared-main' |
6 | import { CustomMarkupComponent } from './shared' | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * Markup component that creates a channel miniature only | 9 | * Markup component that creates a channel miniature only |
@@ -13,11 +14,13 @@ import { VideoChannel, VideoChannelService, VideoService } from '../../shared-ma | |||
13 | templateUrl: 'channel-miniature-markup.component.html', | 14 | templateUrl: 'channel-miniature-markup.component.html', |
14 | styleUrls: [ 'channel-miniature-markup.component.scss' ] | 15 | styleUrls: [ 'channel-miniature-markup.component.scss' ] |
15 | }) | 16 | }) |
16 | export class ChannelMiniatureMarkupComponent implements OnInit { | 17 | export class ChannelMiniatureMarkupComponent implements CustomMarkupComponent, OnInit { |
17 | @Input() name: string | 18 | @Input() name: string |
18 | @Input() displayLatestVideo: boolean | 19 | @Input() displayLatestVideo: boolean |
19 | @Input() displayDescription: boolean | 20 | @Input() displayDescription: boolean |
20 | 21 | ||
22 | @Output() loaded = new EventEmitter<boolean>() | ||
23 | |||
21 | channel: VideoChannel | 24 | channel: VideoChannel |
22 | descriptionHTML: string | 25 | descriptionHTML: string |
23 | totalVideos: number | 26 | totalVideos: number |
@@ -61,9 +64,13 @@ export class ChannelMiniatureMarkupComponent implements OnInit { | |||
61 | map(user => user.nsfwPolicy), | 64 | map(user => user.nsfwPolicy), |
62 | switchMap(nsfwPolicy => this.videoService.getVideoChannelVideos({ ...videoOptions, nsfwPolicy })) | 65 | switchMap(nsfwPolicy => this.videoService.getVideoChannelVideos({ ...videoOptions, nsfwPolicy })) |
63 | ) | 66 | ) |
64 | .subscribe(({ total, data }) => { | 67 | .subscribe({ |
65 | this.totalVideos = total | 68 | next: ({ total, data }) => { |
66 | this.video = data[0] | 69 | this.totalVideos = total |
70 | this.video = data[0] | ||
71 | }, | ||
72 | |||
73 | complete: () => this.loaded.emit(true) | ||
67 | }) | 74 | }) |
68 | } | 75 | } |
69 | } | 76 | } |