mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
stop the now playing title flickering on every track change
The title effect was keyed on both the queue context and the per-track fallback (album name), so advancing a track reset the resolved playlist/album name to the album fallback until the async lookup returned. Key only on the queue context; `remember(queueContext)` already resets it synchronously when the context changes.
This commit is contained in:
@@ -92,9 +92,8 @@ fun NowPlayingRoute(
|
||||
} else {
|
||||
state.item?.album?.takeIf { it.isNotBlank() } ?: "Library"
|
||||
}
|
||||
val sourceTitle = remember(queueContext, fallbackTitle) { mutableStateOf(fallbackTitle) }
|
||||
LaunchedEffect(queueContext, fallbackTitle) {
|
||||
sourceTitle.value = fallbackTitle
|
||||
val sourceTitle = remember(queueContext) { mutableStateOf(fallbackTitle) }
|
||||
LaunchedEffect(queueContext) {
|
||||
sourceTitle.value = controller.sourceTitle(queueContext)?.takeIf { it.isNotBlank() } ?: fallbackTitle
|
||||
}
|
||||
LaunchedEffect(state.item?.id, state.hasNext) {
|
||||
|
||||
Reference in New Issue
Block a user