]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/abstract-video-list.ts
Add button in subscriptions to go to subscriptions list
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / abstract-video-list.ts
index faeea27d9fc77f598e37db7e8f50f5137bc21a61..06d4ed43d5cd705c782d277037e47171edbfaf70 100644 (file)
@@ -59,6 +59,12 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
     blacklistInfo: false
   }
 
+  actions: {
+    routerLink: string
+    iconName: string
+    label: string
+  }[] = []
+
   onDataSubject = new Subject<any[]>()
 
   protected serverConfig: ServerConfig
@@ -146,10 +152,11 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
     this.loadMoreVideos()
   }
 
-  loadMoreVideos () {
+  loadMoreVideos (reset = false) {
     this.getVideosObservable(this.pagination.currentPage).subscribe(
       ({ data, total }) => {
         this.pagination.totalItems = total
+        if (reset) this.videos = []
         this.videos = this.videos.concat(data)
 
         if (this.groupByDate) this.buildGroupedDateLabels()
@@ -159,14 +166,18 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
         this.onDataSubject.next(data)
       },
 
-      error => this.notifier.error(error.message)
+      error => {
+        const message = this.i18n('Cannot load more videos. Try again later.')
+
+        console.error(message, { error })
+        this.notifier.error(message)
+      }
     )
   }
 
   reloadVideos () {
     this.pagination.currentPage = 1
-    this.videos = []
-    this.loadMoreVideos()
+    this.loadMoreVideos(true)
   }
 
   toggleModerationDisplay () {