Fix initial filter and page on startup

This commit is contained in:
Ash 2022-07-10 22:59:09 +08:00
parent 7a47329902
commit 4416b6792d
2 changed files with 9 additions and 6 deletions

View File

@ -53,11 +53,6 @@ fun HomeEntry(
}
LaunchedEffect(Unit) {
navController.currentBackStackEntryFlow.collectLatest {
Log.i("RLog", "isReadingPage: ${navController.currentDestination?.route}")
delay(310L)
isReadingPage = navController.currentDestination?.route == "${RouteName.READING}/{articleId}"
}
when (context.initialPage) {
1 -> {
navController.navigate(RouteName.FLOW) {
@ -77,6 +72,14 @@ fun HomeEntry(
}
)
)
// This is finally
navController.currentBackStackEntryFlow.collectLatest {
Log.i("RLog", "currentBackStackEntry: ${navController.currentDestination?.route}")
// Animation duration takes 310 ms
delay(310L)
isReadingPage = navController.currentDestination?.route == "${RouteName.READING}/{articleId}"
}
}
LaunchedEffect(openArticleId) {

View File

@ -95,7 +95,7 @@
<string name="accounts_desc">लोकल, नया आर एस एस </string>
<string name="color_and_style">रंग अथवा शैली </string>
<string name="color_and_style_desc">थीम , रंग शैली , लिपि आकार </string>
<string name="interaction">Interaction</string>
<string name="interaction">प्रभाव</string>
<string name="interaction_desc">शुरू होने पे , हैप्टिक फीडबैक </string>
<string name="languages">भाषाएँ </string>
<string name="languages_desc">अंग्रेजी , चाइनीज, और..</string>