]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/rest/rest-table.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / core / rest / rest-table.ts
index a5b48f10c6f17dc85108ce7e049003c1ee0a378a..7b765f7fc09e2fd3f6b7ab4a380309f1fd43f511 100644 (file)
@@ -39,6 +39,10 @@ export abstract class RestTable {
     }
   }
 
+  saveSort () {
+    peertubeLocalStorage.setItem(this.getSortLocalStorageKey(), JSON.stringify(this.sort))
+  }
+
   loadLazy (event: LazyLoadEvent) {
     logger('Load lazy %o.', event)
 
@@ -47,35 +51,19 @@ export abstract class RestTable {
       field: event.sortField
     }
 
+    this.rowsPerPage = event.rows
+
     this.pagination = {
       start: event.first,
       count: this.rowsPerPage
     }
 
+    this.expandedRows = {}
+
     this.reloadData()
     this.saveSort()
   }
 
-  saveSort () {
-    peertubeLocalStorage.setItem(this.getSortLocalStorageKey(), JSON.stringify(this.sort))
-  }
-
-  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.reloadData()
-    }
-
-    this.expandedRows = {}
-  }
-
   onSearch (search: string) {
     this.search = search
     this.reloadData()