mapbox-navigation-android icon indicating copy to clipboard operation
mapbox-navigation-android copied to clipboard

MapboxManeuverView does not handle error result

Open korshaknn opened this issue 2 years ago • 0 comments

MapboxManeuverView currently renders maneuvers only when the result is Success and the components list is not empty

fun renderManeuvers(maneuvers: Expected<ManeuverError, List<Maneuver>>) {
        maneuvers.onValue { list ->
            if (list.isNotEmpty()) {
                currentlyRenderedManeuvers.clear()
                currentlyRenderedManeuvers.addAll(list)
                renderManeuvers()
            }
        }
    }

In this case if the list is empty or the result is error, then the view would continue to show previous maneuver.

korshaknn avatar Apr 11 '22 09:04 korshaknn