HomeScreen: Add static key for TabNavigator (#10191)

Fixes incorrect tab selection after process death

(cherry picked from commit 8ff2c01bf28d9d645796b7e616d3ab5c6f85a86c)
This commit is contained in:
Ivan Iskandar 2023-11-29 22:43:21 +07:00 committed by Jobobby04
parent 865ec2e47b
commit 35d4a154b4

View File

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