diff options
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts')
-rw-r--r-- | client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts index 02738022e..afa4f4799 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { finalize } from 'rxjs/operators' | ||
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 2 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { AuthService } from '@app/core' | 3 | import { AuthService, Notifier } from '@app/core' |
3 | import { VideoFilter, VideoSortField } from '@shared/models' | 4 | import { VideoFilter, VideoSortField } from '@shared/models' |
4 | import { Video, VideoService } from '../../shared-main' | 5 | import { Video, VideoService } from '../../shared-main' |
5 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' | 6 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' |
@@ -40,7 +41,8 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit | |||
40 | 41 | ||
41 | constructor ( | 42 | constructor ( |
42 | private auth: AuthService, | 43 | private auth: AuthService, |
43 | private videoService: VideoService | 44 | private videoService: VideoService, |
45 | private notifier: Notifier | ||
44 | ) { } | 46 | ) { } |
45 | 47 | ||
46 | getUser () { | 48 | getUser () { |
@@ -76,10 +78,11 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit | |||
76 | } | 78 | } |
77 | 79 | ||
78 | this.videoService.getVideos(options) | 80 | this.videoService.getVideos(options) |
79 | .subscribe({ | 81 | .pipe(finalize(() => this.loaded.emit(true))) |
80 | next: ({ data }) => this.videos = data, | 82 | .subscribe( |
83 | ({ data }) => this.videos = data, | ||
81 | 84 | ||
82 | complete: () => this.loaded.emit(true) | 85 | err => this.notifier.error('Error in videos list component: ' + err.message) |
83 | }) | 86 | ) |
84 | } | 87 | } |
85 | } | 88 | } |