X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-video-playlist%2Fvideo-playlist-element-miniature.component.ts;h=ea58d7f76a675b5cbfd40e1b442762732218dd56;hb=ae9809a7d021fcaf01ee482a9c6c59fdd50125a6;hp=2e495ec266c7a95e8a472df0840947690f4b9195;hpb=9e8789497377cac5554a622da605f5b89587aa9c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts index 2e495ec26..ea58d7f76 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts @@ -88,14 +88,14 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { const videoId = this.playlistElement.video ? this.playlistElement.video.id : undefined this.videoPlaylistService.removeVideoFromPlaylist(this.playlist.id, playlistElement.id, videoId) - .subscribe( - () => { + .subscribe({ + next: () => { this.notifier.success($localize`Video removed from ${this.playlist.displayName}`) this.elementRemoved.emit(playlistElement) }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) this.moreDropdown.close() } @@ -107,8 +107,8 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { body.stopTimestamp = this.timestampOptions.stopTimestampEnabled ? this.timestampOptions.stopTimestamp : null this.videoPlaylistService.updateVideoOfPlaylist(this.playlist.id, playlistElement.id, body, this.playlistElement.video.id) - .subscribe( - () => { + .subscribe({ + next: () => { this.notifier.success($localize`Timestamps updated`) playlistElement.startTimestamp = body.startTimestamp @@ -117,8 +117,8 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { this.cdr.detectChanges() }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) this.moreDropdown.close() } @@ -166,9 +166,6 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { } } - // FIXME: why do we have to use setTimeout here? - setTimeout(() => { - this.cdr.detectChanges() - }) + this.cdr.markForCheck() } }