diff options
-rw-r--r-- | client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts | 4 |
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( |