aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-05-17 14:52:44 +0200
committerChocobozzz <me@florianbigard.com>2019-05-17 14:52:44 +0200
commitb767c4a74aa5ce44c7b6a89962cb153ecb3ace07 (patch)
tree4f554863e74ffe6ec49259c56c8d1506e0efbcf2 /client/src/app/+my-account
parent1c8ddbfaa03e241c782201343d424748efc191c1 (diff)
downloadPeerTube-b767c4a74aa5ce44c7b6a89962cb153ecb3ace07.tar.gz
PeerTube-b767c4a74aa5ce44c7b6a89962cb153ecb3ace07.tar.zst
PeerTube-b767c4a74aa5ce44c7b6a89962cb153ecb3ace07.zip
Fix reordering playlist
Diffstat (limited to 'client/src/app/+my-account')
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
index 25d51d2cb..03f34412c 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
@@ -67,7 +67,9 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
67 if (previousIndex === newIndex) return 67 if (previousIndex === newIndex) return
68 68
69 const oldPosition = this.videos[previousIndex].playlistElement.position 69 const oldPosition = this.videos[previousIndex].playlistElement.position
70 const insertAfter = newIndex === 0 ? 0 : this.videos[newIndex].playlistElement.position 70 let insertAfter = this.videos[newIndex].playlistElement.position
71
72 if (oldPosition > insertAfter) insertAfter--
71 73
72 this.videoPlaylistService.reorderPlaylist(this.playlist.id, oldPosition, insertAfter) 74 this.videoPlaylistService.reorderPlaylist(this.playlist.id, oldPosition, insertAfter)
73 .subscribe( 75 .subscribe(