Skip to content

Commit

Permalink
Merge pull request #33266 from dukenv0307/fix/32397
Browse files Browse the repository at this point in the history
Accept save distance when editing in offline mode
  • Loading branch information
neil-marcellini authored Dec 22, 2023
2 parents b0e038f + ab3dcd8 commit 4f2ba01
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 4f2ba01

Please sign in to comment.