What’s the best way to avoid clicking two items at...
# compose
t
What’s the best way to avoid clicking two items at the same time and navigating to both at once with compose navigation?
🤔 1
f
Double clicking the same item is not an issue?
t
Also is
f
I use this:
Copy code
val NavBackStackEntry.isResumed: Boolean
    get() = lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)
And then use like this:
Copy code
onNavigateToNotifications = {
    if (navEntry.isResumed) {
        navController.navigate(Destination.Notifications.route)
    }
}
You get
navEntry
as input parameter of
composable
destination
content
lambda
t
This fixed it, thanks Filip!
🎉 1