Răsfoiți Sursa

HomeScreen: Add static key for TabNavigator (#10191)

Fixes incorrect tab selection after process death
Ivan Iskandar 1 an în urmă
părinte
comite
8ff2c01bf2

+ 2 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/home/HomeScreen.kt

@@ -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) {