Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d57bc11c authored by mitulsheth's avatar mitulsheth
Browse files

fix(ai-review): This itinerary is too long

- Resolve AI Code review
parent 690bf1be
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ class RouteStateRepository {
    }

    fun setDirectionError(directionError: DirectionUiError?) {
        _routeState.value = _routeState.value.copy(isLoading = false, directionError = directionError)
        _routeState.value = _routeState.value.copy(isLoading = false, directionError = directionError, error = null)
    }

    fun clear() {
+8 −10
Original line number Diff line number Diff line
@@ -501,18 +501,16 @@ private fun NonTransitRouteResults(
                DirectionUiError.DistanceExceeded -> stringResource(string.long_itinerary_error_message)
                is DirectionUiError.Unknown -> routeState.directionError.message?.let {
                    stringResource(string.directions_error, routeState.directionError.message)
                } ?: stringResource(string.unknown_error)
            }
            }
            message?.let {
            Text(
                    text = it,
                text = message,
                color = MaterialTheme.colorScheme.error,
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(dimensionResource(dimen.padding))
            )
        }
        }

        routeState.routes.isNotEmpty() -> {
            FerrostarRouteResults(
+1 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@
    <string name="routing_mode">Routing Mode</string>
    <string name="directions">Directions</string>
    <string name="long_itinerary_error_message">This itinerary is too long</string>
    <string name="unknown_error">Unknown error occurred</string>
    <string name="from">From</string>
    <string name="to">To</string>
    <string name="routing_profile_format">Profile: %1$s</string>
+2 −1
Original line number Diff line number Diff line
@@ -312,7 +312,8 @@ class DirectionsViewModelTest {
        advanceUntilIdle()

        assertFalse(state.isLoading)
        assertTrue(state.routes.isEmpty())
        val updatedState = viewModel.routeState.value
        assertTrue(updatedState.routes.isEmpty())
        coVerifyOrder {
            mockRouteStateRepository.setLoading(true)
            mockRouteStateRepository.setDirectionError(DirectionUiError.DistanceExceeded)