HomeScreen: Add static key for TabNavigator

Fixes incorrect tab selection after process death
This commit is contained in:
Ivan Iskandar 2023-11-25 22:24:45 +07:00
parent e22eebfd02
commit 9b8283d6ce
No known key found for this signature in database
GPG key ID: 2C57784F9E46D60D

View file

@ -66,6 +66,7 @@ object HomeScreen : Screen() {
private val showBottomNavEvent = Channel<Boolean>()
private const val TabFadeDuration = 200
private const val TabNavigatorKey = "HomeTabs"
private val tabs = listOf(
LibraryTab,
@ -80,6 +81,7 @@ object HomeScreen : Screen() {
val navigator = LocalNavigator.currentOrThrow
TabNavigator(
tab = LibraryTab,
key = TabNavigatorKey,
) { tabNavigator ->
// Provide usable navigator to content screen
CompositionLocalProvider(LocalNavigator provides navigator) {