Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerGery committed Jan 21, 2024
1 parent 7cbc51d commit 61021d5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions examples/client/Locomotion/src/context/newRideContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,20 @@ const RidePageContextProvider = ({ children }: {
});
};

const updateRidePayload = (newRide: RideInterface) => {
setRide({
...ride,
...newRide,
});
};

const FAILED_ESTIMATIONS_ACTIONS = {
[ESTIMATION_ERRORS['RIDE_VALIDATION:SOME_STOP_POINTS_ARE_OUT_OF_TERRITORY']]: () => changeBsPage(BS_PAGES.NOT_IN_TERRITORY),
[ESTIMATION_ERRORS.FIRST_STOP_POINT_NOT_IN_TERRITORY]: () => changeBsPage(BS_PAGES.PICKUP_NOT_IN_TERRITORY),
[ESTIMATION_ERRORS.CLIENT_NOT_IN_BUSINESS_ACCOUNT]: async () => {
await StorageService.delete('lastBusinessAccountId');
setBusinessAccountId(null);
updateRidePayload({ paymentMethodId: undefined });
},
};

Expand All @@ -400,12 +408,6 @@ const RidePageContextProvider = ({ children }: {
return timezoneResponse.time;
};

const updateRidePayload = (newRide: RideInterface) => {
setRide({
...ride,
...newRide,
});
};

const getBusinessAccountIdWithFallback = async (paymentChosen: boolean) => {
const doNotUseFallback = paymentChosen || businessAccountId;
Expand Down

0 comments on commit 61021d5

Please sign in to comment.