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
3 changes: 3 additions & 0 deletions src/hooks/useDeleteTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac
const [betas] = useOnyx(ONYXKEYS.BETAS);
const {isBetaEnabled} = usePermissions();
const archivedReportsIdSet = useArchivedReportsIdSet();
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);

/**
* Delete transactions by IDs
Expand Down Expand Up @@ -156,6 +157,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac
quickAction,
iouReportNextStep,
betas,
personalDetails,
Comment thread
dukenv0307 marked this conversation as resolved.
Resolved
});
}

Expand Down Expand Up @@ -207,6 +209,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac
reportActions,
transactionViolations,
betas,
personalDetails,
],
);

Expand Down
4 changes: 4 additions & 0 deletions src/libs/actions/IOU/Split.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ type UpdateSplitTransactionsParams = {
iouReportNextStep: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>;
betas: OnyxEntry<OnyxTypes.Beta[]>;
isFromSplitExpensesFlow?: boolean;
personalDetails: OnyxEntry<OnyxTypes.PersonalDetailsList>;
};

type SplitBillActionsParams = {
Expand Down Expand Up @@ -1043,6 +1044,7 @@ function updateSplitTransactions({
iouReportNextStep,
isFromSplitExpensesFlow,
betas,
personalDetails,
}: UpdateSplitTransactionsParams) {
const transactionReport = getReportOrDraftReport(transactionData?.reportID);
const parentTransactionReport = getReportOrDraftReport(transactionReport?.parentReportID);
Expand Down Expand Up @@ -1199,6 +1201,7 @@ function updateSplitTransactions({
quickAction,
policyRecentlyUsedCurrencies,
betas,
personalDetails,
} as MoneyRequestInformationParams;

if (isReverseSplitOperation) {
Expand Down Expand Up @@ -1255,6 +1258,7 @@ function updateSplitTransactions({
shouldGenerateTransactionThreadReport: !isReverseSplitOperation,
policyRecentlyUsedCurrencies,
betas,
personalDetails,
});

let updateMoneyRequestParamsOnyxData: OnyxData<UpdateMoneyRequestDataKeys> = {};
Expand Down
8 changes: 7 additions & 1 deletion src/libs/actions/IOU/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
policyRecentlyUsedCurrencies: string[];
betas: OnyxEntry<OnyxTypes.Beta[]>;
customUnitPolicyID?: string;
personalDetails: OnyxEntry<OnyxTypes.PersonalDetailsList>;
shouldHandleNavigation?: boolean;
};

Expand All @@ -549,6 +550,7 @@
quickAction: OnyxEntry<OnyxTypes.QuickAction>;
policyRecentlyUsedCurrencies: string[];
betas: OnyxEntry<OnyxTypes.Beta[]>;
personalDetails: OnyxEntry<OnyxTypes.PersonalDetailsList>;
};

type RequestMoneyInformation = {
Expand Down Expand Up @@ -609,7 +611,7 @@
transactionViolations: OnyxCollection<OnyxTypes.TransactionViolation[]>;
quickAction: OnyxEntry<OnyxTypes.QuickAction>;
policyRecentlyUsedCurrencies: string[];
personalDetails?: OnyxEntry<OnyxTypes.PersonalDetailsList>;
personalDetails: OnyxEntry<OnyxTypes.PersonalDetailsList>;
};

type MoneyRequestOptimisticParams = {
Expand Down Expand Up @@ -811,7 +813,7 @@
};

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

Check warning on line 816 in src/libs/actions/IOU/index.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 @@ -907,7 +909,7 @@
};

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

Check warning on line 912 in src/libs/actions/IOU/index.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 @@ -921,7 +923,7 @@
});

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

Check warning on line 926 in src/libs/actions/IOU/index.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 @@ -930,7 +932,7 @@
});

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

Check warning on line 935 in src/libs/actions/IOU/index.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 @@ -944,7 +946,7 @@
});

let allPolicyTags: OnyxCollection<OnyxTypes.PolicyTagLists> = {};
Onyx.connect({

Check warning on line 949 in src/libs/actions/IOU/index.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_TAGS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -957,7 +959,7 @@
});

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

Check warning on line 962 in src/libs/actions/IOU/index.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 @@ -966,7 +968,7 @@
});

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

Check warning on line 971 in src/libs/actions/IOU/index.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 All @@ -976,7 +978,7 @@

let userAccountID = -1;
let currentUserEmail = '';
Onyx.connect({

Check warning on line 981 in src/libs/actions/IOU/index.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.SESSION,
callback: (value) => {
currentUserEmail = value?.email ?? '';
Expand All @@ -985,7 +987,7 @@
});

let deprecatedCurrentUserPersonalDetails: OnyxEntry<OnyxTypes.PersonalDetails>;
Onyx.connect({

Check warning on line 990 in src/libs/actions/IOU/index.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) => {
deprecatedCurrentUserPersonalDetails = value?.[userAccountID] ?? undefined;
Expand All @@ -993,7 +995,7 @@
});

let allReportActions: OnyxCollection<OnyxTypes.ReportActions>;
Onyx.connect({

Check warning on line 998 in src/libs/actions/IOU/index.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_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand Down Expand Up @@ -3822,6 +3824,7 @@
quickAction,
policyRecentlyUsedCurrencies,
betas,
personalDetails,
} = perDiemExpenseInformation;
const {payeeAccountID = userAccountID, payeeEmail = currentUserEmail, participant} = participantParams;
const {policy, policyCategories, policyTagList, policyRecentlyUsedCategories, policyRecentlyUsedTags} = policyParams;
Expand Down Expand Up @@ -4051,6 +4054,7 @@
currentUserEmailParam,
hasViolations,
quickAction,
personalDetails,
});

return {
Expand Down Expand Up @@ -6885,6 +6889,7 @@
policyRecentlyUsedCurrencies,
betas,
customUnitPolicyID,
personalDetails,
shouldHandleNavigation = true,
} = submitPerDiemExpenseInformation;
const {payeeAccountID} = participantParams;
Expand Down Expand Up @@ -6933,6 +6938,7 @@
quickAction,
policyRecentlyUsedCurrencies,
betas,
personalDetails,
});

const activeReportID = isMoneyRequestReport && Navigation.getTopmostReportId() === report?.reportID ? report?.reportID : chatReport.reportID;
Expand Down
2 changes: 2 additions & 0 deletions src/pages/iou/SplitExpensePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function SplitExpensePage({route}: SplitExpensePageProps) {
const splitFieldDataFromOriginalTransaction = initSplitExpenseItemData(transaction, transactionReport, {isManuallyEdited: true});
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [quickAction] = useOnyx(ONYXKEYS.NVP_QUICK_ACTION_GLOBAL_CREATE);
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);
const icons = useMemoizedLazyExpensifyIcons(['ArrowsLeftRight', 'Plus'] as const);

const {isBetaEnabled} = usePermissions();
Expand Down Expand Up @@ -303,6 +304,7 @@ function SplitExpensePage({route}: SplitExpensePageProps) {
quickAction,
iouReportNextStep,
betas,
personalDetails,
});
};

Expand Down
2 changes: 2 additions & 0 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ function IOURequestStepConfirmation({
policyRecentlyUsedCurrencies: policyRecentlyUsedCurrencies ?? [],
quickAction,
betas,
personalDetails,
});
}
},
Expand All @@ -822,6 +823,7 @@ function IOURequestStepConfirmation({
policyRecentlyUsedCurrencies,
quickAction,
betas,
personalDetails,
],
);

Expand Down
Loading
Loading