From 41d713446c2152d47943ddb0c841a9e36ca5a9db Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 15 Feb 2019 15:52:18 +0100 Subject: Lazy import some modules --- client/src/app/videos/+video-watch/comment/video-comment.component.ts | 4 ++-- client/src/app/videos/+video-watch/modal/video-support.component.ts | 4 +++- client/src/app/videos/+video-watch/video-watch.component.ts | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'client/src/app/videos/+video-watch') diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts index aba7f9d1c..172eb0a39 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts @@ -85,8 +85,8 @@ export class VideoCommentComponent implements OnInit, OnChanges { ) } - private init () { - this.sanitizedCommentHTML = this.htmlRenderer.toSafeHtml(this.comment.text) + private async init () { + this.sanitizedCommentHTML = await this.htmlRenderer.toSafeHtml(this.comment.text) this.newParentComments = this.parentComments.concat([ this.comment ]) } diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.ts b/client/src/app/videos/+video-watch/modal/video-support.component.ts index deb8fbc67..5e7afa012 100644 --- a/client/src/app/videos/+video-watch/modal/video-support.component.ts +++ b/client/src/app/videos/+video-watch/modal/video-support.component.ts @@ -21,7 +21,9 @@ export class VideoSupportComponent { ) { } show () { - this.videoHTMLSupport = this.markdownService.enhancedMarkdownToHTML(this.video.support) this.modalService.open(this.modal) + + this.markdownService.enhancedMarkdownToHTML(this.video.support) + .then(r => this.videoHTMLSupport = r) } } diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 4dbfa41e5..0f04441ba 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -325,8 +325,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.setVideoDescriptionHTML() } - private setVideoDescriptionHTML () { - this.videoHTMLDescription = this.markdownService.textMarkdownToHTML(this.video.description) + private async setVideoDescriptionHTML () { + this.videoHTMLDescription = await this.markdownService.textMarkdownToHTML(this.video.description) } private setVideoLikesBarTooltipText () { -- cgit v1.2.3