Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporarily keep routes after they have been popped. (#23)
Temporarily keep routes after they have been popped. This fix a crash that can occur when navigating and pressing back almost at the same time on android. When popping, the route was immediately removed from the routes but android did not have time to render it. findRoute would be called after and find nothing. This keeps the popped routes in a separate list for 5 seconds to make sure that if android needs them to compose the view, they are still accessible. Hooking on the nav controller listeners when the destinations changed was still too early. This was the stack trace java.lang.IllegalStateException: Cannot find route with id ad54c5e1-1f82-4010-9011-15ba06d3992a at com.mirego.pilot.navigation.compose.PilotNavigationHelpersKt.findRoute(PilotNavigationHelpers.kt:24) ...
- Loading branch information