From 1378c0d343028f3d40d7d795422684ab9e6a1599 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Aug 2021 11:27:47 +0200 Subject: Fix client lint --- .../shared/comment/video-comment-add.component.ts | 8 ++--- .../shared/comment/video-comment.component.ts | 8 ++--- .../shared/comment/video-comments.component.ts | 42 +++++++++++----------- 3 files changed, 29 insertions(+), 29 deletions(-) (limited to 'client/src/app/+videos/+video-watch/shared/comment') 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, obs = this.addCommentThread(commentCreate) } - obs.subscribe( - comment => { + obs.subscribe({ + next: comment => { this.addingComment = false this.commentCreated.emit(comment) this.form.reset() }, - err => { + error: err => { this.addingComment = false this.notifier.error(err.text) } - ) + }) } 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 { const user = this.authService.getUser() if (user.hasRight(UserRight.MANAGE_USERS)) { this.userService.getUserWithCache(account.userId) - .subscribe( - user => this.commentUser = user, + .subscribe({ + next: user => this.commentUser = user, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } } 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 { 'filter:api.video-watch.video-thread-replies.list.result' ) - obs.subscribe( - res => { - this.threadComments[commentId] = res - this.threadLoading[commentId] = false - this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res }) + obs.subscribe({ + next: res => { + this.threadComments[commentId] = res + this.threadLoading[commentId] = false + this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res }) - if (highlightThread) { - this.highlightedThread = new VideoComment(res.comment) + if (highlightThread) { + this.highlightedThread = new VideoComment(res.comment) - // Scroll to the highlighted thread - setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) - } - }, + // Scroll to the highlighted thread + setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) + } + }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } loadMoreThreads () { @@ -123,8 +123,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { 'filter:api.video-watch.video-threads.list.result' ) - obs.subscribe( - res => { + obs.subscribe({ + next: res => { this.comments = this.comments.concat(res.data) this.componentPagination.totalItems = res.total this.totalNotDeletedComments = res.totalNotDeletedComments @@ -133,8 +133,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination }) }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } onCommentThreadCreated (comment: VideoComment) { @@ -181,8 +181,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { if (res === false) return false this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) - .subscribe( - () => { + .subscribe({ + next: () => { if (this.highlightedThread?.id === commentToDelete.id) { commentToDelete = this.comments.find(c => c.id === commentToDelete.id) @@ -193,8 +193,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { this.softDeleteComment(commentToDelete) }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) return true } -- cgit v1.2.3