- this.loadData()
- this.saveSort()
- }
-
- saveSort () {
- peertubeLocalStorage.setItem(this.getSortLocalStorageKey(), JSON.stringify(this.sort))
- }
-
- initSearch () {
- this.searchStream = new Subject()
-
- this.searchStream
- .pipe(
- debounceTime(400),
- distinctUntilChanged()
- )
- .subscribe(search => {
- this.search = search
-
- logger('On search %s.', this.search)
-
- this.loadData()
- })
- }
-
- onSearch (event: Event) {
- const target = event.target as HTMLInputElement
- this.searchStream.next(target.value)
- }
-
- onPage (event: { first: number, rows: number }) {
- logger('On page %o.', event)
-
- if (this.rowsPerPage !== event.rows) {
- this.rowsPerPage = event.rows
- this.pagination = {
- start: event.first,
- count: this.rowsPerPage
- }
-
- this.loadData()
- }
-