Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
report: OnyxEntry<OnyxTypes.Report>;
participantParams: RequestMoneyParticipantParams;
policyParams?: BasePolicyParams;
gpsPoints?: GPSPoint;
gpsPoint?: GPSPoint;
action?: IOUAction;
transactionParams: RequestMoneyTransactionParams;
isRetry?: boolean;
Expand Down Expand Up @@ -627,7 +627,7 @@
billable?: boolean;
reimbursable?: boolean;
validWaypoints?: WaypointCollection;
gpsPoints?: GPSPoint;
gpsPoint?: GPSPoint;
actionableWhisperReportActionID?: string;
linkedTrackedExpenseReportAction?: OnyxTypes.ReportAction;
linkedTrackedExpenseReportID?: string;
Expand Down Expand Up @@ -716,7 +716,7 @@
};

let allPersonalDetails: OnyxTypes.PersonalDetailsList = {};
Onyx.connect({

Check warning on line 719 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value ?? {};
Expand Down Expand Up @@ -797,13 +797,13 @@
};

let allBetas: OnyxEntry<OnyxTypes.Beta[]>;
Onyx.connect({

Check warning on line 800 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.BETAS,
callback: (value) => (allBetas = value),
});

let allTransactions: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 806 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -817,7 +817,7 @@
});

let allTransactionDrafts: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 820 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_DRAFT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -826,7 +826,7 @@
});

let allTransactionViolations: NonNullable<OnyxCollection<OnyxTypes.TransactionViolations>> = {};
Onyx.connect({

Check warning on line 829 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -840,7 +840,7 @@
});

let allNextSteps: NonNullable<OnyxCollection<OnyxTypes.ReportNextStep>> = {};
Onyx.connect({

Check warning on line 843 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.NEXT_STEP,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -849,7 +849,7 @@
});

const allPolicies: OnyxCollection<OnyxTypes.Policy> = {};
Onyx.connect({

Check warning on line 852 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
callback: (val, key) => {
if (!key) {
Expand Down Expand Up @@ -885,14 +885,14 @@
// `allRecentlyUsedTags` was moved here temporarily from `src/libs/actions/Policy/Tag.ts` during the `Deprecate Onyx.connect` refactor.
// All uses of this variable should be replaced with `useOnyx`.
let allRecentlyUsedTags: OnyxCollection<RecentlyUsedTags> = {};
Onyx.connect({

Check warning on line 888 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_TAGS,
waitForCollectionCallback: true,
callback: (val) => (allRecentlyUsedTags = val),
});

let allReports: OnyxCollection<OnyxTypes.Report>;
Onyx.connect({

Check warning on line 895 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -901,7 +901,7 @@
});

let allReportNameValuePairs: OnyxCollection<OnyxTypes.ReportNameValuePairs>;
Onyx.connect({

Check warning on line 904 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -6069,7 +6069,7 @@
participantParams,
policyParams = {},
transactionParams,
gpsPoints,
gpsPoint,
action,
shouldHandleNavigation = true,
backToReport,
Expand Down Expand Up @@ -6268,7 +6268,7 @@
taxAmount,
billable,
// This needs to be a string of JSON because of limitations with the fetch() API and nested objects
receiptGpsPoints: gpsPoints ? JSON.stringify(gpsPoints) : undefined,
receiptGpsPoints: gpsPoint ? JSON.stringify(gpsPoint) : undefined,
transactionThreadReportID,
createdReportActionIDForThread,
reimbursable,
Expand Down Expand Up @@ -6526,7 +6526,7 @@
taxAmount = 0,
billable,
reimbursable,
gpsPoints,
gpsPoint,
validWaypoints,
actionableWhisperReportActionID,
linkedTrackedExpenseReportAction,
Expand Down Expand Up @@ -6567,7 +6567,7 @@
taxAmount,
billable,
validWaypoints,
gpsPoints,
gpsPoint,
actionableWhisperReportActionID,
linkedTrackedExpenseReportAction,
linkedTrackedExpenseReportID,
Expand Down Expand Up @@ -6774,7 +6774,7 @@
taxAmount,
billable,
// This needs to be a string of JSON because of limitations with the fetch() API and nested objects
receiptGpsPoints: gpsPoints ? JSON.stringify(gpsPoints) : undefined,
receiptGpsPoints: gpsPoint ? JSON.stringify(gpsPoint) : undefined,
transactionThreadReportID,
createdReportActionIDForThread,
waypoints: sanitizedWaypoints,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Share/SubmitDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function SubmitDetailsPage({
const defaultTaxCode = getDefaultTaxCode(policy, transaction);
const transactionTaxCode = (transaction?.taxCode ? transaction?.taxCode : defaultTaxCode) ?? '';

const finishRequestAndNavigate = (participant: Participant, receipt: Receipt, gpsPoints?: GpsPoint) => {
const finishRequestAndNavigate = (participant: Participant, receipt: Receipt, gpsPoint?: GpsPoint) => {
if (!transaction) {
return;
}
Expand Down Expand Up @@ -141,7 +141,7 @@ function SubmitDetailsPage({
report,
participantParams: {payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, participant},
policyParams: {policy, policyTagList: policyTags, policyCategories, policyRecentlyUsedCategories},
gpsPoints,
gpsPoint,
action: CONST.IOU.TYPE.CREATE,
transactionParams: {
attendees: transaction.comment?.attendees,
Expand Down
8 changes: 4 additions & 4 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ function IOURequestStepConfirmation({
}, [requestType, iouType, initialTransactionID, reportID, action, report, transactions, participants]);

const requestMoney = useCallback(
(selectedParticipants: Participant[], gpsPoints?: GpsPoint) => {
(selectedParticipants: Participant[], gpsPoint?: GpsPoint) => {
if (!transactions.length) {
return;
}
Expand Down Expand Up @@ -554,7 +554,7 @@ function IOURequestStepConfirmation({
policyCategories,
policyRecentlyUsedCategories,
},
gpsPoints,
gpsPoint,
action,
transactionParams: {
amount: isTestReceipt ? CONST.TEST_RECEIPT.AMOUNT : item.amount,
Expand Down Expand Up @@ -673,7 +673,7 @@ function IOURequestStepConfirmation({
);

const trackExpense = useCallback(
(selectedParticipants: Participant[], gpsPoints?: GpsPoint) => {
(selectedParticipants: Participant[], gpsPoint?: GpsPoint) => {
if (!transactions.length) {
return;
}
Expand Down Expand Up @@ -713,7 +713,7 @@ function IOURequestStepConfirmation({
taxAmount: transactionTaxAmount,
billable: item.billable,
reimbursable: item.reimbursable,
gpsPoints,
gpsPoint,
validWaypoints: Object.keys(item?.comment?.waypoints ?? {}).length ? getValidWaypoints(item.comment?.waypoints, true) : undefined,
actionableWhisperReportActionID: item.actionableWhisperReportActionID,
linkedTrackedExpenseReportAction: item.linkedTrackedExpenseReportAction,
Expand Down
12 changes: 6 additions & 6 deletions src/pages/iou/request/step/IOURequestStepScan/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function IOURequestStepScan({
focusIndicatorScale.set(withSpring(1, {damping: 10, stiffness: 200}));
focusIndicatorPosition.set(point);

scheduleOnRN(() => focusCamera(point));
scheduleOnRN(focusCamera, point);
});

useFocusEffect(
Expand Down Expand Up @@ -303,7 +303,7 @@ function IOURequestStepScan({
(
files: ReceiptFile[],
participant: Participant,
gpsPoints?: GpsPoint,
gpsPoint?: GpsPoint,
policyParams?: {
policy: OnyxEntry<Policy>;
},
Expand Down Expand Up @@ -331,7 +331,7 @@ function IOURequestStepScan({
receipt,
billable,
reimbursable,
...(gpsPoints ?? {}),
gpsPoint,
},
...(policyParams ?? {}),
shouldHandleNavigation: index === files.length - 1,
Expand All @@ -345,7 +345,7 @@ function IOURequestStepScan({
participant,
},
...(policyParams ?? {}),
...(gpsPoints ?? {}),
gpsPoint,
transactionParams: {
amount: 0,
attendees: transaction?.comment?.attendees,
Expand Down Expand Up @@ -449,11 +449,11 @@ function IOURequestStepScan({
getCurrentPosition(
(successData) => {
const policyParams = {policy};
const gpsPoints = {
const gpsPoint = {
lat: successData.coords.latitude,
long: successData.coords.longitude,
};
createTransaction(files, participant, gpsPoints, policyParams, false);
createTransaction(files, participant, gpsPoint, policyParams, false);
},
(errorData) => {
Log.info('[IOURequestStepScan] getCurrentPosition failed', false, errorData);
Expand Down
10 changes: 5 additions & 5 deletions src/pages/iou/request/step/IOURequestStepScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function IOURequestStepScan({
(
files: ReceiptFile[],
participant: Participant,
gpsPoints?: GpsPoint,
gpsPoint?: GpsPoint,
policyParams?: {
policy: OnyxEntry<Policy>;
},
Expand Down Expand Up @@ -390,7 +390,7 @@ function IOURequestStepScan({
receipt,
billable,
reimbursable,
...(gpsPoints ?? {}),
gpsPoint,
},
...(policyParams ?? {}),
shouldHandleNavigation: index === files.length - 1,
Expand All @@ -404,7 +404,7 @@ function IOURequestStepScan({
participant,
},
...(policyParams ?? {}),
...(gpsPoints ?? {}),
gpsPoint,
transactionParams: {
amount: 0,
attendees: transaction?.comment?.attendees,
Expand Down Expand Up @@ -509,11 +509,11 @@ function IOURequestStepScan({
getCurrentPosition(
(successData) => {
const policyParams = {policy};
const gpsPoints = {
const gpsPoint = {
lat: successData.coords.latitude,
long: successData.coords.longitude,
};
createTransaction(files, participant, gpsPoints, policyParams, false, true);
createTransaction(files, participant, gpsPoint, policyParams, false, true);
},
(errorData) => {
Log.info('[IOURequestStepScan] getCurrentPosition failed', false, errorData);
Expand Down
Loading