Skip to content

Commit

Permalink
playlist: Actually make changes when reordering
Browse files Browse the repository at this point in the history
* Fixes DD3Boh#266
  • Loading branch information
mikooomich authored and reocat committed Jan 30, 2025
1 parent 4904f8c commit ef1d419
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ fun LocalPlaylistScreen(
scrollThresholdPadding = LocalPlayerAwareWindowInsets.current.asPaddingValues()
) { from, to ->
if (to.index >= headerItems && from.index >= headerItems) {
val currentDragInfo = dragInfo
dragInfo = if (currentDragInfo == null) {
(from.index - headerItems) to (to.index - headerItems)
} else {
currentDragInfo.first to (to.index - headerItems)
}

mutableSongs.move(from.index - headerItems, to.index - headerItems)
}
}
Expand Down

0 comments on commit ef1d419

Please sign in to comment.