mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +01:00
re-register the overlay back callback when the overlay state changes
On the library no navigation happens, so ours was registered before the NavHost's and lost; keying the DisposableEffect on the overlay flags re-adds it last as soon as the overlay opens.
This commit is contained in:
@@ -393,7 +393,7 @@ private fun MainNavigation() {
|
|||||||
SideEffect {
|
SideEffect {
|
||||||
backCallback.isEnabled = showingQueue || nowPlayingOpen || navController.previousBackStackEntry != null
|
backCallback.isEnabled = showingQueue || nowPlayingOpen || navController.previousBackStackEntry != null
|
||||||
}
|
}
|
||||||
DisposableEffect(backDispatcher, currentRoute) {
|
DisposableEffect(backDispatcher, currentRoute, showingQueue, nowPlayingOpen) {
|
||||||
backDispatcher?.addCallback(backCallback)
|
backDispatcher?.addCallback(backCallback)
|
||||||
onDispose { backCallback.remove() }
|
onDispose { backCallback.remove() }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user