Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Handle errors when updating a playlist

Chocobozzz4d6dc3105766
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts
index f83fb6dc1b..1279b77f43 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts
@@ -39,6 +39,8 @@ export class MyVideoPlaylistElementsComponent implements OnInit, OnDestroy {
readonly videoShareModal = viewChild<VideoShareComponent>('videoShareModal')
+ private errored = false
+
playlistElements: VideoPlaylistElement[] = []
playlist: VideoPlaylist
@@ -177,18 +179,36 @@ export class MyVideoPlaylistElementsComponent implements OnInit, OnDestroy {
'my-library',
'filter:api.my-library.video-playlist-elements.list.params',
'filter:api.my-library.video-playlist-elements.list.result'
- ).subscribe(({ total, data }) => {
- this.playlistElements = this.playlistElements.concat(data)
- this.pagination.totalItems = total
-
- this.onDataSubject.next(data)
+ ).subscribe({
+ next: ({ total, data }) => {
+ this.playlistElements = this.playlistElements.concat(data)
+ this.pagination.totalItems = total
+
+ this.onDataSubject.next(data)
+ },
+
+ error: err => {
+ if (!this.errored) {
+ this.notifier.handleError(err)
+ this.errored = true
+ }
+ }
})
}
private loadPlaylistInfo () {
this.videoPlaylistService.getVideoPlaylist(this.videoPlaylistId)
- .subscribe(playlist => {
- this.playlist = playlist
+ .subscribe({
+ next: playlist => {
+ this.playlist = playlist
+ },
+
+ error: err => {
+ if (!this.errored) {
+ this.notifier.handleError(err)
+ this.errored = true
+ }
+ }
})
}