diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 11:27:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:01:45 +0200 |
commit | 1378c0d343028f3d40d7d795422684ab9e6a1599 (patch) | |
tree | 08062b84a38a7e2dfe0aa674e7ca8e1b7321044e /client/src/app/+videos/+video-watch/shared/comment | |
parent | c186a67f90203af6bfa434f026efdc99193bcd65 (diff) | |
download | PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip |
Fix client lint
Diffstat (limited to 'client/src/app/+videos/+video-watch/shared/comment')
3 files changed, 29 insertions, 29 deletions
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts index 78efe1684..ac65f7260 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts | |||
@@ -137,19 +137,19 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, | |||
137 | obs = this.addCommentThread(commentCreate) | 137 | obs = this.addCommentThread(commentCreate) |
138 | } | 138 | } |
139 | 139 | ||
140 | obs.subscribe( | 140 | obs.subscribe({ |
141 | comment => { | 141 | next: comment => { |
142 | this.addingComment = false | 142 | this.addingComment = false |
143 | this.commentCreated.emit(comment) | 143 | this.commentCreated.emit(comment) |
144 | this.form.reset() | 144 | this.form.reset() |
145 | }, | 145 | }, |
146 | 146 | ||
147 | err => { | 147 | error: err => { |
148 | this.addingComment = false | 148 | this.addingComment = false |
149 | 149 | ||
150 | this.notifier.error(err.text) | 150 | this.notifier.error(err.text) |
151 | } | 151 | } |
152 | ) | 152 | }) |
153 | } | 153 | } |
154 | 154 | ||
155 | isAddButtonDisplayed () { | 155 | isAddButtonDisplayed () { |
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.ts index 0e1c4c207..f858f4750 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.ts | |||
@@ -149,11 +149,11 @@ export class VideoCommentComponent implements OnInit, OnChanges { | |||
149 | const user = this.authService.getUser() | 149 | const user = this.authService.getUser() |
150 | if (user.hasRight(UserRight.MANAGE_USERS)) { | 150 | if (user.hasRight(UserRight.MANAGE_USERS)) { |
151 | this.userService.getUserWithCache(account.userId) | 151 | this.userService.getUserWithCache(account.userId) |
152 | .subscribe( | 152 | .subscribe({ |
153 | user => this.commentUser = user, | 153 | next: user => this.commentUser = user, |
154 | 154 | ||
155 | err => this.notifier.error(err.message) | 155 | error: err => this.notifier.error(err.message) |
156 | ) | 156 | }) |
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts index 2c39e63fb..72866b874 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts | |||
@@ -90,22 +90,22 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
90 | 'filter:api.video-watch.video-thread-replies.list.result' | 90 | 'filter:api.video-watch.video-thread-replies.list.result' |
91 | ) | 91 | ) |
92 | 92 | ||
93 | obs.subscribe( | 93 | obs.subscribe({ |
94 | res => { | 94 | next: res => { |
95 | this.threadComments[commentId] = res | 95 | this.threadComments[commentId] = res |
96 | this.threadLoading[commentId] = false | 96 | this.threadLoading[commentId] = false |
97 | this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res }) | 97 | this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res }) |
98 | 98 | ||
99 | if (highlightThread) { | 99 | if (highlightThread) { |
100 | this.highlightedThread = new VideoComment(res.comment) | 100 | this.highlightedThread = new VideoComment(res.comment) |
101 | 101 | ||
102 | // Scroll to the highlighted thread | 102 | // Scroll to the highlighted thread |
103 | setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) | 103 | setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) |
104 | } | 104 | } |
105 | }, | 105 | }, |
106 | 106 | ||
107 | err => this.notifier.error(err.message) | 107 | error: err => this.notifier.error(err.message) |
108 | ) | 108 | }) |
109 | } | 109 | } |
110 | 110 | ||
111 | loadMoreThreads () { | 111 | loadMoreThreads () { |
@@ -123,8 +123,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
123 | 'filter:api.video-watch.video-threads.list.result' | 123 | 'filter:api.video-watch.video-threads.list.result' |
124 | ) | 124 | ) |
125 | 125 | ||
126 | obs.subscribe( | 126 | obs.subscribe({ |
127 | res => { | 127 | next: res => { |
128 | this.comments = this.comments.concat(res.data) | 128 | this.comments = this.comments.concat(res.data) |
129 | this.componentPagination.totalItems = res.total | 129 | this.componentPagination.totalItems = res.total |
130 | this.totalNotDeletedComments = res.totalNotDeletedComments | 130 | this.totalNotDeletedComments = res.totalNotDeletedComments |
@@ -133,8 +133,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
133 | this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination }) | 133 | this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination }) |
134 | }, | 134 | }, |
135 | 135 | ||
136 | err => this.notifier.error(err.message) | 136 | error: err => this.notifier.error(err.message) |
137 | ) | 137 | }) |
138 | } | 138 | } |
139 | 139 | ||
140 | onCommentThreadCreated (comment: VideoComment) { | 140 | onCommentThreadCreated (comment: VideoComment) { |
@@ -181,8 +181,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
181 | if (res === false) return false | 181 | if (res === false) return false |
182 | 182 | ||
183 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) | 183 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) |
184 | .subscribe( | 184 | .subscribe({ |
185 | () => { | 185 | next: () => { |
186 | if (this.highlightedThread?.id === commentToDelete.id) { | 186 | if (this.highlightedThread?.id === commentToDelete.id) { |
187 | commentToDelete = this.comments.find(c => c.id === commentToDelete.id) | 187 | commentToDelete = this.comments.find(c => c.id === commentToDelete.id) |
188 | 188 | ||
@@ -193,8 +193,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
193 | this.softDeleteComment(commentToDelete) | 193 | this.softDeleteComment(commentToDelete) |
194 | }, | 194 | }, |
195 | 195 | ||
196 | err => this.notifier.error(err.message) | 196 | error: err => this.notifier.error(err.message) |
197 | ) | 197 | }) |
198 | 198 | ||
199 | return true | 199 | return true |
200 | } | 200 | } |