You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StateFlow won't emit the same value twice.
For example, if we enter a screen and then press the android back button (without using navigationManager), then we will not be able to navigate by the same route.
The text was updated successfully, but these errors were encountered:
I was able to mitigate the issue using following changes:
// Instead of mutable state, I am using shared flow so that I can see duplicates
var commands = MutableSharedFlow<NavigationCommand>(
extraBufferCapacity = 1,
onBufferOverflow = BufferOverflow.DROP_OLDEST
)
// To support MutableSharedFlow
fun navigate(directions: NavigationCommand) {
commands.tryEmit(directions)
}
This is working for me properly. If there are some other better methods, I would like to know that also.
StateFlow won't emit the same value twice.
For example, if we enter a screen and then press the android back button (without using navigationManager), then we will not be able to navigate by the same route.
The text was updated successfully, but these errors were encountered: