Tlaster / PreCompose

Compose Multiplatform Navigation && State Management

Home Page:https://tlaster.github.io/PreCompose/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Precompose navigation got my current scene unactive

enmanuel52 opened this issue · comments

As simple as that, when i navigate from login(scene) to home screen(group), and get back once the user logout is having this behaviour

If you can check the code out here: https://github.com/enmanuel52/Pop-Corns/tree/feat_auth i will appreciate

I'm sending out the pictures of how it looks like for active and inactive case.

Screenshot_20240204-181643
Screenshot_20240204-181700

I tried another approach, here is the code that did not change, but I don´t see anything wrong:

const val LOGIN_GRAPH_ROUTE = "/login_graph_route"
private const val LOGIN_ROUTE = "login_route"

fun Navigator.navigateToLoginScreen(navOptions: NavOptions? = null) {
    navigate(LOGIN_GRAPH_ROUTE, navOptions)
}

fun RouteBuilder.loginRoute(onLoginSucceed: () -> Unit) {
    group(LOGIN_GRAPH_ROUTE, "/$LOGIN_ROUTE") {
        scene(
            "/$LOGIN_ROUTE", navTransition = NavTransition()
        ) {
            LoginRoute(onLoginSucceed)
        }
    }
}

I owe you and appologize 😅, I had some drawer state open that kept out the focus , your library still rocks!!