X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fvideo%2Fabstract-video-list.ts;h=06d4ed43d5cd705c782d277037e47171edbfaf70;hb=13adf228d0cc48995cf70c0a782a1d717873f6e0;hp=faeea27d9fc77f598e37db7e8f50f5137bc21a61;hpb=ba430d7516bc5b1324b60571ba7594460969b7fb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index faeea27d9..06d4ed43d 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts @@ -59,6 +59,12 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor blacklistInfo: false } + actions: { + routerLink: string + iconName: string + label: string + }[] = [] + onDataSubject = new Subject() 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 () {