Skip to content

Commit

Permalink
Accept save distance when editting in offline mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Dec 19, 2023
1 parent aa1d87c commit ab3dcd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/DistanceRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function DistanceRequest({transactionID, report, transaction, route, isEditingRe

const submitWaypoints = useCallback(() => {
// If there is any error or loading state, don't let user go to next page.
if (_.size(validatedWaypoints) < 2 || hasRouteError || isLoadingRoute || isLoading) {
if (_.size(validatedWaypoints) < 2 || hasRouteError || isLoadingRoute || (isLoading && !isOffline)) {
setHasError(true);
return;
}
Expand All @@ -216,7 +216,7 @@ function DistanceRequest({transactionID, report, transaction, route, isEditingRe
}

onSubmit(waypoints);
}, [onSubmit, setHasError, hasRouteError, isLoadingRoute, isLoading, validatedWaypoints, waypoints, isEditingNewRequest, isEditingRequest]);
}, [onSubmit, setHasError, hasRouteError, isLoadingRoute, isLoading, validatedWaypoints, waypoints, isEditingNewRequest, isEditingRequest, isOffline]);

const content = (
<>
Expand Down

0 comments on commit ab3dcd8

Please sign in to comment.