import { concat, Observable } from 'rxjs'
import { tap, toArray } from 'rxjs/operators'
-import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'
+import { Component, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { AuthService, ComponentPagination, ConfirmService, Notifier, RouteFilter, ScreenService, ServerService, User } from '@app/core'
+import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenService, ServerService, User } from '@app/core'
import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
import { immutableAssign } from '@app/helpers'
import { AdvancedInputFilter } from '@app/shared/shared-forms'
templateUrl: './my-videos.component.html',
styleUrls: [ './my-videos.component.scss' ]
})
-export class MyVideosComponent extends RouteFilter implements OnInit, AfterViewInit, DisableForReuseHook {
+export class MyVideosComponent implements OnInit, DisableForReuseHook {
@ViewChild('videosSelection', { static: true }) videosSelection: VideosSelectionComponent
@ViewChild('videoChangeOwnershipModal', { static: true }) videoChangeOwnershipModal: VideoChangeOwnershipComponent
@ViewChild('liveStreamInformationModal', { static: true }) liveStreamInformationModal: LiveStreamInformationComponent
videos: Video[] = []
getVideosObservableFunction = this.getVideosObservable.bind(this)
+
sort: VideoSortField = '-publishedAt'
user: User
}
]
+ private search: string
+
constructor (
protected router: Router,
protected serverService: ServerService,
private confirmService: ConfirmService,
private videoService: VideoService
) {
- super()
-
this.titlePage = $localize`My videos`
}
this.buildActions()
this.user = this.authService.getUser()
-
- this.initSearch()
- this.listenToSearchChange()
}
- ngAfterViewInit () {
- if (this.search) this.setTableFilter(this.search, false)
+ onSearch (search: string) {
+ this.search = search
+ this.reloadData()
}
- loadData () {
+ reloadData () {
this.videosSelection.reloadVideos()
}