diff options
Diffstat (limited to 'client/src/app/+my-library/my-videos/my-videos.component.ts')
-rw-r--r-- | client/src/app/+my-library/my-videos/my-videos.component.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/app/+my-library/my-videos/my-videos.component.ts b/client/src/app/+my-library/my-videos/my-videos.component.ts index 0bc923e73..d6e66e617 100644 --- a/client/src/app/+my-library/my-videos/my-videos.component.ts +++ b/client/src/app/+my-library/my-videos/my-videos.component.ts | |||
@@ -43,6 +43,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { | |||
43 | videosSearch: string | 43 | videosSearch: string |
44 | videosSearchChanged = new Subject<string>() | 44 | videosSearchChanged = new Subject<string>() |
45 | getVideosObservableFunction = this.getVideosObservable.bind(this) | 45 | getVideosObservableFunction = this.getVideosObservable.bind(this) |
46 | sort: VideoSortField = '-publishedAt' | ||
46 | 47 | ||
47 | user: User | 48 | user: User |
48 | 49 | ||
@@ -80,6 +81,10 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { | |||
80 | this.videosSearchChanged.next() | 81 | this.videosSearchChanged.next() |
81 | } | 82 | } |
82 | 83 | ||
84 | onChangeSortColumn () { | ||
85 | this.videosSelection.reloadVideos() | ||
86 | } | ||
87 | |||
83 | disableForReuse () { | 88 | disableForReuse () { |
84 | this.videosSelection.disableForReuse() | 89 | this.videosSelection.disableForReuse() |
85 | } | 90 | } |
@@ -91,7 +96,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { | |||
91 | getVideosObservable (page: number, sort: VideoSortField) { | 96 | getVideosObservable (page: number, sort: VideoSortField) { |
92 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | 97 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) |
93 | 98 | ||
94 | return this.videoService.getMyVideos(newPagination, sort, this.videosSearch) | 99 | return this.videoService.getMyVideos(newPagination, this.sort, this.videosSearch) |
95 | .pipe( | 100 | .pipe( |
96 | tap(res => this.pagination.totalItems = res.total) | 101 | tap(res => this.pagination.totalItems = res.total) |
97 | ) | 102 | ) |