X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Baccounts%2Faccount-video-channels%2Faccount-video-channels.component.ts;h=59814a93d4aca2160486188ea26a96b6d2e97bcb;hb=0e45e336f62a411b3c423be46d16252355c754d7;hp=e146a5cd2c4075b53ab19d08f88faab160d7f3a9;hpb=cf21b2cbef61929177b9c09b5e017c3b7eb8535d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts index e146a5cd2..59814a93d 100644 --- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts +++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts @@ -1,10 +1,10 @@ import { from, Subject, Subscription } from 'rxjs' import { concatMap, map, switchMap, tap } from 'rxjs/operators' import { Component, OnDestroy, OnInit } from '@angular/core' -import { ComponentPagination, hasMoreItems, MarkdownService, ScreenService, User, UserService } from '@app/core' +import { ComponentPagination, hasMoreItems, MarkdownService, User, UserService } from '@app/core' import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' -import { NSFWPolicyType, VideoSortField } from '@shared/models' import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature' +import { NSFWPolicyType, VideoSortField } from '@shared/models' @Component({ selector: 'my-account-video-channels', @@ -62,6 +62,7 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy { this.accountSub = this.accountService.accountLoaded .subscribe(account => { this.account = account + this.videoChannels = [] this.loadMoreChannels() }) @@ -87,7 +88,9 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy { this.videoChannelService.listAccountVideoChannels(options) .pipe( - tap(res => this.channelPagination.totalItems = res.total), + tap(res => { + this.channelPagination.totalItems = res.total + }), switchMap(res => from(res.data)), concatMap(videoChannel => { const options = { @@ -102,7 +105,11 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy { }) ) .subscribe(async ({ videoChannel, videos, total }) => { - this.channelsDescriptionHTML[videoChannel.id] = await this.markdown.textMarkdownToHTML(videoChannel.description) + this.channelsDescriptionHTML[videoChannel.id] = await this.markdown.textMarkdownToHTML({ + markdown: videoChannel.description, + withEmoji: true, + withHtml: true + }) this.videoChannels.push(videoChannel) @@ -113,14 +120,14 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy { } getVideosOf (videoChannel: VideoChannel) { - const obj = this.videos[ videoChannel.id ] + const obj = this.videos[videoChannel.id] if (!obj) return [] return obj.videos } getTotalVideosOf (videoChannel: VideoChannel) { - const obj = this.videos[ videoChannel.id ] + const obj = this.videos[videoChannel.id] if (!obj) return undefined return obj.total