diff options
Diffstat (limited to 'client/src/app/videos/+video-watch/comment/video-comments.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comments.component.ts | 11 |
1 files changed, 9 insertions, 2 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 e81401553..974c61d6c 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 | |||
@@ -6,7 +6,7 @@ import { VideoCommentThreadTree } from '../../../../../../shared/models/videos/v | |||
6 | import { AuthService } from '../../../core/auth' | 6 | import { AuthService } from '../../../core/auth' |
7 | import { ComponentPagination, hasMoreItems } from '../../../shared/rest/component-pagination.model' | 7 | import { ComponentPagination, hasMoreItems } from '../../../shared/rest/component-pagination.model' |
8 | import { User } from '../../../shared/users' | 8 | import { User } from '../../../shared/users' |
9 | import { VideoSortField } from '../../../shared/video/sort-field.type' | 9 | import { CommentSortField } from '../../../shared/video/sort-field.type' |
10 | import { VideoDetails } from '../../../shared/video/video-details.model' | 10 | import { VideoDetails } from '../../../shared/video/video-details.model' |
11 | import { VideoComment } from './video-comment.model' | 11 | import { VideoComment } from './video-comment.model' |
12 | import { VideoCommentService } from './video-comment.service' | 12 | import { VideoCommentService } from './video-comment.service' |
@@ -28,7 +28,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
28 | 28 | ||
29 | comments: VideoComment[] = [] | 29 | comments: VideoComment[] = [] |
30 | highlightedThread: VideoComment | 30 | highlightedThread: VideoComment |
31 | sort: VideoSortField = '-createdAt' | 31 | sort: CommentSortField = '-createdAt' |
32 | componentPagination: ComponentPagination = { | 32 | componentPagination: ComponentPagination = { |
33 | currentPage: 1, | 33 | currentPage: 1, |
34 | itemsPerPage: 10, | 34 | itemsPerPage: 10, |
@@ -152,6 +152,13 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
152 | this.viewReplies(commentTree.comment.id) | 152 | this.viewReplies(commentTree.comment.id) |
153 | } | 153 | } |
154 | 154 | ||
155 | handleSortChange (sort: CommentSortField) { | ||
156 | if (this.sort === sort) return | ||
157 | |||
158 | this.sort = sort | ||
159 | this.resetVideo() | ||
160 | } | ||
161 | |||
155 | handleTimestampClicked (timestamp: number) { | 162 | handleTimestampClicked (timestamp: number) { |
156 | this.timestampClicked.emit(timestamp) | 163 | this.timestampClicked.emit(timestamp) |
157 | } | 164 | } |