mirror of
				https://github.com/Chocobozzz/PeerTube.git
				synced 2025-02-25 18:55:32 -06:00 
			
		
		
		
	Client: reset pagination when we search something
This commit is contained in:
		@@ -66,6 +66,8 @@ export class VideoListComponent implements OnInit, OnDestroy {
 | 
			
		||||
    // Subscribe to search changes
 | 
			
		||||
    this.subSearch = this.searchService.searchUpdated.subscribe(search => {
 | 
			
		||||
      this.search = search;
 | 
			
		||||
      // Reset pagination
 | 
			
		||||
      this.pagination.currentPage = 1;
 | 
			
		||||
 | 
			
		||||
      this.navigateToNewParams();
 | 
			
		||||
    });
 | 
			
		||||
@@ -76,7 +78,7 @@ export class VideoListComponent implements OnInit, OnDestroy {
 | 
			
		||||
    this.subSearch.unsubscribe();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getVideos(detectChanges = true) {
 | 
			
		||||
  getVideos() {
 | 
			
		||||
    this.loading.next(true);
 | 
			
		||||
    this.videos = [];
 | 
			
		||||
 | 
			
		||||
@@ -153,7 +155,11 @@ export class VideoListComponent implements OnInit, OnDestroy {
 | 
			
		||||
 | 
			
		||||
    this.sort = <SortField>routeParams['sort'] || '-createdDate';
 | 
			
		||||
 | 
			
		||||
    this.pagination.currentPage = parseInt(routeParams['page']) || 1;
 | 
			
		||||
    if (routeParams['page'] !== undefined) {
 | 
			
		||||
      this.pagination.currentPage = parseInt(routeParams['page']);
 | 
			
		||||
    } else {
 | 
			
		||||
      this.pagination.currentPage = 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this.changeDetector.detectChanges();
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -35,12 +35,12 @@
 | 
			
		||||
    "src/app/admin/admin.routes.ts",
 | 
			
		||||
    "src/app/admin/friends/friend-list/friend-list.component.ts",
 | 
			
		||||
    "src/app/admin/friends/friend-list/index.ts",
 | 
			
		||||
    "src/app/admin/friends/friends.component.ts",
 | 
			
		||||
    "src/app/admin/friends/friends.routes.ts",
 | 
			
		||||
    "src/app/admin/friends/index.ts",
 | 
			
		||||
    "src/app/admin/friends/shared/friend.model.ts",
 | 
			
		||||
    "src/app/admin/friends/shared/friend.service.ts",
 | 
			
		||||
    "src/app/admin/friends/shared/index.ts",
 | 
			
		||||
    "src/app/admin/friends/users.component.ts",
 | 
			
		||||
    "src/app/admin/index.ts",
 | 
			
		||||
    "src/app/admin/menu-admin.component.ts",
 | 
			
		||||
    "src/app/admin/users/index.ts",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user