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()
}
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
this.cdr.detectChanges()
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
this.moreDropdown.close()
}
}
}
- // FIXME: why do we have to use setTimeout here?
- setTimeout(() => {
- this.cdr.detectChanges()
- })
+ this.cdr.markForCheck()
}
}