From c174d027673521dfd156633863350b2d34ceb8eb Mon Sep 17 00:00:00 2001 From: laolu Date: Tue, 28 Jul 2026 18:59:22 -0400 Subject: [PATCH] Make only one instance of a song have the playing icon --- .../com/maxrave/simpmusic/ui/component/ModalBottomSheet.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/com/maxrave/simpmusic/ui/component/ModalBottomSheet.kt b/composeApp/src/commonMain/kotlin/com/maxrave/simpmusic/ui/component/ModalBottomSheet.kt index d6c743569..a6de98e20 100644 --- a/composeApp/src/commonMain/kotlin/com/maxrave/simpmusic/ui/component/ModalBottomSheet.kt +++ b/composeApp/src/commonMain/kotlin/com/maxrave/simpmusic/ui/component/ModalBottomSheet.kt @@ -927,6 +927,11 @@ fun QueueBottomSheet( queueData?.data?.listTracks ?: emptyList() } } + val currentSongIndex by remember(queue, songEntity) { + derivedStateOf { + musicServiceHandler.currentOrderIndex().takeIf { it > -1 } ?: 0 + } + } val loadMoreState by remember { derivedStateOf { queueData?.queueState ?: QueueData.StateSource.STATE_CREATED @@ -1167,7 +1172,7 @@ fun QueueBottomSheet( ) { _ -> SongFullWidthItems( track = track, - isPlaying = track.videoId == songEntity?.videoId, + isPlaying = index == currentSongIndex, modifier = Modifier .fillMaxWidth(),