]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-watch/comment/video-comment.component.ts
Correct break line display for re-draft comments
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / comment / video-comment.component.ts
index fe069b54c3cb6521e0040fbe64182e8efd55c616..ac2a71aa6f59d615f315c40d4546ffc1557a4e0e 100644 (file)
@@ -75,7 +75,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
 
     this.resetReply.emit()
 
-    delete this.redraftValue
+    this.redraftValue = undefined
   }
 
   onWantToReply (comment?: VideoComment) {
@@ -125,7 +125,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
       this.comment.account &&
       this.isUserLoggedIn() &&
       this.comment.isDeleted === false &&
-      this.authService.getUser().account.id !== this.comment.account.id
+      this.user.account.id !== this.comment.account.id
     )
   }
 
@@ -133,6 +133,10 @@ export class VideoCommentComponent implements OnInit, OnChanges {
     ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
   }
 
+  isNotDeletedOrDeletedWithReplies () {
+    return !this.comment.isDeleted || this.comment.isDeleted && this.comment.totalReplies !== 0
+  }
+
   private getUserIfNeeded (account: Account) {
     if (!account.userId) return
     if (!this.authService.isLoggedIn()) return
@@ -149,7 +153,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
   }
 
   private async init () {
-    const html = await this.markdownService.textMarkdownToHTML(this.comment.text, true)
+    const html = await this.markdownService.textMarkdownToHTML(this.comment.text, true, true)
     this.sanitizedCommentHTML = await this.markdownService.processVideoTimestamps(html)
     this.newParentComments = this.parentComments.concat([ this.comment ])
 
@@ -164,7 +168,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
 
     if (this.isReportableByUser()) {
       this.prependModerationActions.push({
-        label: $localize`Report`,
+        label: $localize`Report this comment`,
         iconName: 'flag',
         handler: () => this.showReportModal()
       })