]> 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 5491023ee5f6fd8e31a6c3b7f3d2d612cb3216fc..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
@@ -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()
       })