diff options
Diffstat (limited to 'client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts | 42 |
1 files changed, 21 insertions, 21 deletions
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 | } |