diff options
Diffstat (limited to 'client/src/app/videos/+video-watch/comment/video-comments.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comments.component.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts index c6c28e3f7..bba9f1372 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts | |||
@@ -168,7 +168,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
168 | async onWantedToDelete (commentToDelete: VideoComment) { | 168 | async onWantedToDelete (commentToDelete: VideoComment) { |
169 | let message = 'Do you really want to delete this comment?' | 169 | let message = 'Do you really want to delete this comment?' |
170 | 170 | ||
171 | if (commentToDelete.isLocal) { | 171 | if (commentToDelete.isLocal || this.video.isLocal) { |
172 | message += this.i18n(' The deletion will be sent to remote instances so they can reflect the change.') | 172 | message += this.i18n(' The deletion will be sent to remote instances so they can reflect the change.') |
173 | } else { | 173 | } else { |
174 | message += this.i18n(' It is a remote comment, so the deletion will only be effective on your instance.') | 174 | message += this.i18n(' It is a remote comment, so the deletion will only be effective on your instance.') |
@@ -180,10 +180,14 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
180 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) | 180 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) |
181 | .subscribe( | 181 | .subscribe( |
182 | () => { | 182 | () => { |
183 | if (this.highlightedThread?.id === commentToDelete.id) { | ||
184 | commentToDelete = this.comments.find(c => c.id === commentToDelete.id) | ||
185 | |||
186 | this.highlightedThread = undefined | ||
187 | } | ||
188 | |||
183 | // Mark the comment as deleted | 189 | // Mark the comment as deleted |
184 | this.softDeleteComment(commentToDelete) | 190 | this.softDeleteComment(commentToDelete) |
185 | |||
186 | if (this.highlightedThread?.id === commentToDelete.id) this.highlightedThread = undefined | ||
187 | }, | 191 | }, |
188 | 192 | ||
189 | err => this.notifier.error(err.message) | 193 | err => this.notifier.error(err.message) |