diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-14 14:54:10 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-14 14:54:10 +0200 |
commit | e00aa3535e89d922128c7849f64e0f827d3fb903 (patch) | |
tree | 274193651a5360c48e5c3a71da8faacef6e7511b /client/src | |
parent | 83e9886eedbbcd94292edd3aa135f7c357c9f67a (diff) | |
download | PeerTube-e00aa3535e89d922128c7849f64e0f827d3fb903.tar.gz PeerTube-e00aa3535e89d922128c7849f64e0f827d3fb903.tar.zst PeerTube-e00aa3535e89d922128c7849f64e0f827d3fb903.zip |
Fix deleting highlighted thread
Diffstat (limited to 'client/src')
-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) |