diff options
author | kimsible <kimsible@users.noreply.github.com> | 2020-08-07 23:24:22 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-08-14 15:03:38 +0200 |
commit | ddb0303f4da8777b0c1254eada8b2cd12774b716 (patch) | |
tree | 0048e5c2887d5f43d697829b2360648f2551fbd7 /client/src | |
parent | 3c176894bae9de7958605fe432bff770b9232807 (diff) | |
download | PeerTube-ddb0303f4da8777b0c1254eada8b2cd12774b716.tar.gz PeerTube-ddb0303f4da8777b0c1254eada8b2cd12774b716.tar.zst PeerTube-ddb0303f4da8777b0c1254eada8b2cd12774b716.zip |
Fix i18n on delete modal and linter
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/+videos/+video-watch/comment/video-comment.component.ts | 20 | ||||
-rw-r--r-- | client/src/app/+videos/+video-watch/comment/video-comments.component.ts | 10 |
2 files changed, 20 insertions, 10 deletions
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 8473350be..fe069b54c 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 | |||
@@ -112,11 +112,21 @@ export class VideoCommentComponent implements OnInit, OnChanges { | |||
112 | } | 112 | } |
113 | 113 | ||
114 | isRedraftableByUser () { | 114 | isRedraftableByUser () { |
115 | return this.comment.account && this.isUserLoggedIn() && this.user.account.id === this.comment.account.id && this.comment.totalReplies === 0 | 115 | return ( |
116 | } | 116 | this.comment.account && |
117 | 117 | this.isUserLoggedIn() && | |
118 | isReportableByUser() { | 118 | this.user.account.id === this.comment.account.id && |
119 | return this.comment.account && this.isUserLoggedIn() && this.comment.isDeleted === false && this.authService.getUser().account.id !== this.comment.account.id | 119 | this.comment.totalReplies === 0 |
120 | ) | ||
121 | } | ||
122 | |||
123 | isReportableByUser () { | ||
124 | return ( | ||
125 | this.comment.account && | ||
126 | this.isUserLoggedIn() && | ||
127 | this.comment.isDeleted === false && | ||
128 | this.authService.getUser().account.id !== this.comment.account.id | ||
129 | ) | ||
120 | } | 130 | } |
121 | 131 | ||
122 | switchToDefaultAvatar ($event: Event) { | 132 | switchToDefaultAvatar ($event: Event) { |
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 8080afd8d..9e8e143c2 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 | |||
@@ -160,15 +160,15 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
160 | this.timestampClicked.emit(timestamp) | 160 | this.timestampClicked.emit(timestamp) |
161 | } | 161 | } |
162 | 162 | ||
163 | async onWantedToDelete (commentToDelete: VideoComment, message = 'Do you really want to delete this comment?'): Promise<boolean> { | 163 | async onWantedToDelete(commentToDelete: VideoComment, title = $localize`Delete`, message = $localize`Do you really want to delete this comment?`): Promise<boolean> { |
164 | if (commentToDelete.isLocal || this.video.isLocal) { | 164 | if (commentToDelete.isLocal || this.video.isLocal) { |
165 | message += $localize` The deletion will be sent to remote instances so they can reflect the change.` | 165 | message += $localize` The deletion will be sent to remote instances so they can reflect the change.` |
166 | } else { | 166 | } else { |
167 | message += $localize` It is a remote comment, so the deletion will only be effective on your instance.` | 167 | message += $localize` It is a remote comment, so the deletion will only be effective on your instance.` |
168 | } | 168 | } |
169 | 169 | ||
170 | const res = await this.confirmService.confirm(message, $localize`Delete`) | 170 | const res = await this.confirmService.confirm(message, title) |
171 | if (res === false) return | 171 | if (res === false) return false |
172 | 172 | ||
173 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) | 173 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) |
174 | .subscribe( | 174 | .subscribe( |
@@ -189,8 +189,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
189 | return true | 189 | return true |
190 | } | 190 | } |
191 | 191 | ||
192 | async onWantedToRedraft(commentToRedraft: VideoComment) { | 192 | async onWantedToRedraft (commentToRedraft: VideoComment) { |
193 | const confirm = await this.onWantedToDelete(commentToRedraft, 'Do you really want to delete and re-draft this comment?') | 193 | const confirm = await this.onWantedToDelete(commentToRedraft, $localize`Delete and re-draft`, $localize`Do you really want to delete and re-draft this comment?`) |
194 | 194 | ||
195 | if (confirm) { | 195 | if (confirm) { |
196 | this.inReplyToCommentId = commentToRedraft.inReplyToCommentId | 196 | this.inReplyToCommentId = commentToRedraft.inReplyToCommentId |