X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bmy-account%2Fmy-account-video-playlists%2Fmy-account-video-playlist-elements.component.ts;h=03f34412cabdd6e372104589278211cc79874105;hb=b767c4a74aa5ce44c7b6a89962cb153ecb3ace07;hp=25d51d2cbdb5de89f0201ae0ff7c982048872c1c;hpb=1c8ddbfaa03e241c782201343d424748efc191c1;p=github%2FChocobozzz%2FPeerTube.git 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 if (previousIndex === newIndex) return const oldPosition = this.videos[previousIndex].playlistElement.position - const insertAfter = newIndex === 0 ? 0 : this.videos[newIndex].playlistElement.position + let insertAfter = this.videos[newIndex].playlistElement.position + + if (oldPosition > insertAfter) insertAfter-- this.videoPlaylistService.reorderPlaylist(this.playlist.id, oldPosition, insertAfter) .subscribe(