1 import { Subscription } from 'rxjs'
2 import { Component, OnDestroy, OnInit } from '@angular/core'
3 import { MarkdownService } from '@app/core'
4 import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
7 selector: 'my-video-channel-about',
8 templateUrl: './video-channel-about.component.html',
9 styleUrls: [ './video-channel-about.component.scss' ]
11 export class VideoChannelAboutComponent implements OnInit, OnDestroy {
12 videoChannel: VideoChannel
16 private videoChannelSub: Subscription
19 private videoChannelService: VideoChannelService,
20 private markdownService: MarkdownService
24 // Parent get the video channel for us
25 this.videoChannelSub = this.videoChannelService.videoChannelLoaded
26 .subscribe(async videoChannel => {
27 this.videoChannel = videoChannel
29 this.descriptionHTML = await this.markdownService.textMarkdownToHTML(this.videoChannel.description)
30 this.supportHTML = await this.markdownService.enhancedMarkdownToHTML(this.videoChannel.support)
35 if (this.videoChannelSub) this.videoChannelSub.unsubscribe()
38 getVideoChannelDescription () {
39 if (this.descriptionHTML) return this.descriptionHTML
41 return $localize`No description`