Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanDylann committed Mar 20, 2024
1 parent 7cd0ac5 commit c4b0bbe
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions src/pages/iou/request/step/IOURequestStepDistance.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import lodashGet from 'lodash/get';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {View} from 'react-native';
import { withOnyx } from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import Button from '@components/Button';
import DistanceRequestFooter from '@components/DistanceRequest/DistanceRequestFooter';
Expand All @@ -23,8 +23,8 @@ import * as IOU from '@userActions/IOU';
import * as MapboxToken from '@userActions/MapboxToken';
import * as Transaction from '@userActions/Transaction';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import IOURequestStepRoutePropTypes from './IOURequestStepRoutePropTypes';
import StepScreenWrapper from './StepScreenWrapper';
import withFullTransactionOrNotFound from './withFullTransactionOrNotFound';
Expand All @@ -48,7 +48,7 @@ const propTypes = {
const defaultProps = {
report: {},
transaction: {},
transactionBackup: {}
transactionBackup: {},
};

function IOURequestStepDistance({
Expand All @@ -57,7 +57,7 @@ function IOURequestStepDistance({
params: {action, iouType, reportID, transactionID, backTo},
},
transaction,
transactionBackup
transactionBackup,
}) {
const styles = useThemeStyles();
const {isOffline} = useNetwork();
Expand Down Expand Up @@ -205,9 +205,21 @@ function IOURequestStepDistance({
Navigation.dismissModal(report.reportID);
return;
}

navigateToNextStep();
}, [duplicateWaypointsError, atLeastTwoDifferentWaypointsError, hasRouteError, isLoadingRoute, isLoading, isEditing, navigateToNextStep, transactionBackup, waypoints, transaction.transactionID, report.reportID]);
}, [
duplicateWaypointsError,
atLeastTwoDifferentWaypointsError,
hasRouteError,
isLoadingRoute,
isLoading,
isEditing,
navigateToNextStep,
transactionBackup,
waypoints,
transaction.transactionID,
report.reportID,
]);

return (
<StepScreenWrapper
Expand Down Expand Up @@ -275,8 +287,12 @@ IOURequestStepDistance.displayName = 'IOURequestStepDistance';
IOURequestStepDistance.propTypes = propTypes;
IOURequestStepDistance.defaultProps = defaultProps;

export default compose(withWritableReportOrNotFound, withFullTransactionOrNotFound, withOnyx({
transactionBackup: {
key: (props) => `${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${props.transactionID}`,
},
}))(IOURequestStepDistance);
export default compose(
withWritableReportOrNotFound,
withFullTransactionOrNotFound,
withOnyx({
transactionBackup: {
key: (props) => `${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${props.transactionID}`,
},
}),
)(IOURequestStepDistance);

0 comments on commit c4b0bbe

Please sign in to comment.