mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +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 {
|
} else {
|
||||||
state.item?.album?.takeIf { it.isNotBlank() } ?: "Library"
|
state.item?.album?.takeIf { it.isNotBlank() } ?: "Library"
|
||||||
}
|
}
|
||||||
val sourceTitle = remember(queueContext, fallbackTitle) { mutableStateOf(fallbackTitle) }
|
val sourceTitle = remember(queueContext) { mutableStateOf(fallbackTitle) }
|
||||||
LaunchedEffect(queueContext, fallbackTitle) {
|
LaunchedEffect(queueContext) {
|
||||||
sourceTitle.value = fallbackTitle
|
|
||||||
sourceTitle.value = controller.sourceTitle(queueContext)?.takeIf { it.isNotBlank() } ?: fallbackTitle
|
sourceTitle.value = controller.sourceTitle(queueContext)?.takeIf { it.isNotBlank() } ?: fallbackTitle
|
||||||
}
|
}
|
||||||
LaunchedEffect(state.item?.id, state.hasNext) {
|
LaunchedEffect(state.item?.id, state.hasNext) {
|
||||||
|
|||||||
Reference in New Issue
Block a user