fix: defaultToRead 时打开特定书籍被忽略
当 intent 指定了具体路由(如从书架打开某本书)时, defaultToRead 不应覆盖,只在 intent 为默认首页时才自动跳转最近阅读。
This commit is contained in:
@@ -192,8 +192,12 @@ open class MainActivity : BaseComposeActivity(), VariableDialog.Callback {
|
||||
}
|
||||
|
||||
val startRoutes = remember {
|
||||
if (OtherConfig.defaultToRead) arrayOf(MainRouteHome, MainRouteReadBook())
|
||||
else arrayOf(MainNavigator.resolveStartRoute(intent))
|
||||
val resolved = MainNavigator.resolveStartRoute(intent)
|
||||
if (OtherConfig.defaultToRead && resolved == MainRouteHome) {
|
||||
arrayOf(MainRouteHome, MainRouteReadBook())
|
||||
} else {
|
||||
arrayOf(resolved)
|
||||
}
|
||||
}
|
||||
val backStack = rememberNavBackStack(*startRoutes)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user