diff options
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts')
-rw-r--r-- | client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts index 6ee5123e0..47518abfd 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-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 { Video, VideoService } from '../../shared-main' | 4 | import { Video, VideoService } from '../../shared-main' |
4 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' | 5 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' |
5 | import { CustomMarkupComponent } from './shared' | 6 | import { CustomMarkupComponent } from './shared' |
@@ -34,7 +35,8 @@ export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnI | |||
34 | 35 | ||
35 | constructor ( | 36 | constructor ( |
36 | private auth: AuthService, | 37 | private auth: AuthService, |
37 | private videoService: VideoService | 38 | private videoService: VideoService, |
39 | private notifier: Notifier | ||
38 | ) { } | 40 | ) { } |
39 | 41 | ||
40 | getUser () { | 42 | getUser () { |
@@ -49,10 +51,11 @@ export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnI | |||
49 | } | 51 | } |
50 | 52 | ||
51 | this.videoService.getVideo({ videoId: this.uuid }) | 53 | this.videoService.getVideo({ videoId: this.uuid }) |
52 | .subscribe({ | 54 | .pipe(finalize(() => this.loaded.emit(true))) |
53 | next: video => this.video = video, | 55 | .subscribe( |
56 | video => this.video = video, | ||
54 | 57 | ||
55 | complete: () => this.loaded.emit(true) | 58 | err => this.notifier.error('Error in video miniature component: ' + err.message) |
56 | }) | 59 | ) |
57 | } | 60 | } |
58 | } | 61 | } |