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
17 changes: 9 additions & 8 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ function MoneyReportHeader({
setIsHoldMenuVisible(true);
} else {
startApprovedAnimation();
approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, true);
approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, true);
}
};

Expand Down Expand Up @@ -791,7 +791,7 @@ function MoneyReportHeader({
return;
}
startSubmittingAnimation();
submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled);
submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep);
if (currentSearchQueryJSON && !isOffline) {
search({
searchKey: currentSearchKey,
Expand Down Expand Up @@ -1022,7 +1022,7 @@ function MoneyReportHeader({
showDWEModal();
return;
}
submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled);
submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep);
},
},
[CONST.REPORT.SECONDARY_ACTIONS.APPROVE]: {
Expand Down Expand Up @@ -1053,11 +1053,11 @@ function MoneyReportHeader({
if (result.action !== ModalActions.CONFIRM) {
return;
}
unapproveExpenseReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled);
unapproveExpenseReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep);
return;
}

unapproveExpenseReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled);
unapproveExpenseReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep);
},
},
[CONST.REPORT.SECONDARY_ACTIONS.CANCEL_PAYMENT]: {
Expand Down Expand Up @@ -1238,7 +1238,7 @@ function MoneyReportHeader({
icon: expensifyIcons.CircularArrowBackwards,
value: CONST.REPORT.SECONDARY_ACTIONS.RETRACT,
onSelected: () => {
retractReport(moneyRequestReport, chatReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled);
retractReport(moneyRequestReport, chatReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep);
},
},
[CONST.REPORT.SECONDARY_ACTIONS.REOPEN]: {
Expand All @@ -1258,10 +1258,10 @@ function MoneyReportHeader({
if (result.action !== ModalActions.CONFIRM) {
return;
}
reopenReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled);
reopenReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep);
return;
}
reopenReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled);
reopenReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep);
},
},
[CONST.REPORT.SECONDARY_ACTIONS.REJECT]: {
Expand Down Expand Up @@ -1428,6 +1428,7 @@ function MoneyReportHeader({
isUserValidated,
confirmApproval,
iouReport: moneyRequestReport,
iouReportNextStep: nextStep,
});

const showNextStepBar = shouldShowNextStep && !!optimisticNextStep?.message?.length;
Expand Down
12 changes: 11 additions & 1 deletion src/components/ProcessMoneyReportHoldMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function ProcessMoneyReportHoldMenu({
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
const activePolicy = usePolicy(activePolicyID);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {canBeMissing: true});
const [moneyRequestReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${moneyRequestReport?.reportID}`, {canBeMissing: true});
const {isBetaEnabled} = usePermissions();
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
Expand All @@ -80,7 +81,16 @@ function ProcessMoneyReportHoldMenu({
if (startAnimation) {
startAnimation();
}
approveMoneyRequest(moneyRequestReport, activePolicy, currentUserDetails.accountID, currentUserDetails.email ?? '', hasViolations, isASAPSubmitBetaEnabled, full);
approveMoneyRequest(
moneyRequestReport,
activePolicy,
currentUserDetails.accountID,
currentUserDetails.email ?? '',
hasViolations,
isASAPSubmitBetaEnabled,
moneyRequestReportNextStep,
full,
);
} else if (chatReport && paymentType) {
if (startAnimation) {
startAnimation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ function MoneyRequestReportPreviewContent({
}: MoneyRequestReportPreviewContentProps) {
const [chatReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${chatReportID}`, {canBeMissing: true, allowStaleData: true});
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
const [iouReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${iouReportID}`, {canBeMissing: true});
const activePolicy = usePolicy(activePolicyID);
const [lastDistanceExpenseType] = useOnyx(ONYXKEYS.NVP_LAST_DISTANCE_EXPENSE_TYPE, {canBeMissing: true});
const shouldShowLoading = !chatReportMetadata?.hasOnceLoadedReportActions && transactions.length === 0 && !chatReportMetadata?.isOptimisticReport;
Expand Down Expand Up @@ -267,7 +268,7 @@ function MoneyRequestReportPreviewContent({
setIsHoldMenuVisible(true);
} else {
startApprovedAnimation();
approveMoneyRequest(iouReport, activePolicy, currentUserDetails.accountID, currentUserDetails.email ?? '', hasViolations, isASAPSubmitBetaEnabled, true);
approveMoneyRequest(iouReport, activePolicy, currentUserDetails.accountID, currentUserDetails.email ?? '', hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, true);
}
};

Expand Down Expand Up @@ -532,7 +533,7 @@ function MoneyRequestReportPreviewContent({
return;
}
startSubmittingAnimation();
submitReport(iouReport, policy, currentUserDetails.accountID, currentUserDetails.email ?? '', hasViolations, isASAPSubmitBetaEnabled);
submitReport(iouReport, policy, currentUserDetails.accountID, currentUserDetails.email ?? '', hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep);
}}
isSubmittingAnimationRunning={isSubmittingAnimationRunning}
onAnimationFinish={stopAnimation}
Expand Down
4 changes: 3 additions & 1 deletion src/components/SettlementButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ function SettlementButton({
// The app would crash due to subscribing to the entire report collection if chatReportID is an empty string. So we should have a fallback ID here.
// eslint-disable-next-line rulesdir/no-default-id-values
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || CONST.DEFAULT_NUMBER_ID}`, {canBeMissing: true});
const [iouReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${iouReport?.reportID}`, {canBeMissing: true});

const [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isUserValidatedSelector, canBeMissing: true});
const policyEmployeeAccountIDs = getPolicyEmployeeAccountIDs(policy, accountID);
const reportBelongsToWorkspace = policyID ? doesReportBelongToWorkspace(chatReport, policyEmployeeAccountIDs, policyID) : false;
Expand Down Expand Up @@ -430,7 +432,7 @@ function SettlementButton({
if (confirmApproval) {
confirmApproval();
} else {
approveMoneyRequest(iouReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, false);
approveMoneyRequest(iouReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, false);
}
return;
}
Expand Down
22 changes: 18 additions & 4 deletions src/libs/PaymentUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {BankAccountMenuItem} from '@components/Search/types';
import type {ThemeStyles} from '@styles/index';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import type {Policy, Report} from '@src/types/onyx';
import type {Policy, Report, ReportNextStepDeprecated} from '@src/types/onyx';
import type BankAccount from '@src/types/onyx/BankAccount';
import type Fund from '@src/types/onyx/Fund';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
Expand Down Expand Up @@ -40,6 +40,7 @@ type SelectPaymentTypeParams = {
isUserValidated?: boolean;
confirmApproval?: () => void;
iouReport?: OnyxEntry<Report>;
iouReportNextStep: OnyxEntry<ReportNextStepDeprecated>;
};

/**
Expand Down Expand Up @@ -140,8 +141,21 @@ function calculateWalletTransferBalanceFee(currentBalance: number, methodType: s
* handles direct approvals, or proceeds with basic payment processing.
*/
const selectPaymentType = (params: SelectPaymentTypeParams) => {
const {event, iouPaymentType, triggerKYCFlow, policy, onPress, currentAccountID, currentEmail, hasViolations, isASAPSubmitBetaEnabled, isUserValidated, confirmApproval, iouReport} =
params;
const {
event,
iouPaymentType,
triggerKYCFlow,
policy,
onPress,
currentAccountID,
currentEmail,
hasViolations,
isASAPSubmitBetaEnabled,
isUserValidated,
confirmApproval,
iouReport,
iouReportNextStep,
} = params;
if (policy && shouldRestrictUserBillableActions(policy.id)) {
Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policy.id));
return;
Expand All @@ -161,7 +175,7 @@ const selectPaymentType = (params: SelectPaymentTypeParams) => {
if (confirmApproval) {
confirmApproval();
} else {
approveMoneyRequest(iouReport, policy, currentAccountID, currentEmail, hasViolations, isASAPSubmitBetaEnabled, true);
approveMoneyRequest(iouReport, policy, currentAccountID, currentEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, true);
}
return;
}
Expand Down
38 changes: 22 additions & 16 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@
};

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

Check warning on line 740 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 @@ -831,7 +831,7 @@

let allTransactions: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.TRANSACTION,

Check warning on line 834 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
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
Expand All @@ -846,7 +846,7 @@
let allTransactionDrafts: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.TRANSACTION_DRAFT,
waitForCollectionCallback: true,

Check warning on line 849 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
callback: (value) => {
allTransactionDrafts = value ?? {};
},
Expand All @@ -856,7 +856,7 @@
Onyx.connect({
key: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,
waitForCollectionCallback: true,
callback: (value) => {

Check warning on line 859 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
if (!value) {
allTransactionViolations = {};
return;
Expand All @@ -871,7 +871,7 @@
key: ONYXKEYS.COLLECTION.NEXT_STEP,
waitForCollectionCallback: true,
callback: (value) => {
allNextSteps = value ?? {};

Check warning on line 874 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
},
});

Expand All @@ -881,7 +881,7 @@
callback: (val, key) => {
if (!key) {
return;
}

Check warning on line 884 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
if (val === null || val === undefined) {
delete allPolicies[key];
return;
Expand All @@ -901,7 +901,7 @@
callback: (val) => (allRecentlyUsedTags = val),
});

let allReports: OnyxCollection<OnyxTypes.Report>;

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
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
Expand All @@ -909,7 +909,7 @@
allReports = value;
},
});

Check warning on line 912 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
let allReportNameValuePairs: OnyxCollection<OnyxTypes.ReportNameValuePairs>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
Expand All @@ -919,7 +919,7 @@
},
});

let userAccountID = -1;

Check warning on line 922 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
let currentUserEmail = '';
Onyx.connect({
key: ONYXKEYS.SESSION,
Expand All @@ -930,7 +930,7 @@
});

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

Check warning on line 933 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) => {
deprecatedCurrentUserPersonalDetails = value?.[userAccountID] ?? undefined;
Expand Down Expand Up @@ -10655,6 +10655,7 @@
currentUserEmailParam: string,
hasViolations: boolean,
isASAPSubmitBetaEnabled: boolean,
expenseReportCurrentNextStepDeprecated: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>,
full?: boolean,
) {
if (!expenseReport) {
Expand All @@ -10666,7 +10667,6 @@
return;
}

const currentNextStepDeprecated = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`] ?? null;
let total = expenseReport.total ?? 0;
const hasHeldExpenses = hasHeldExpensesReportUtils(expenseReport.reportID);
const hasDuplicates = hasDuplicateTransactions(currentUserEmailParam, currentUserAccountIDParam, expenseReport, policy);
Expand Down Expand Up @@ -10798,7 +10798,7 @@
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`,
value: currentNextStepDeprecated,
value: expenseReportCurrentNextStepDeprecated ?? null,
},
];

Expand Down Expand Up @@ -10887,12 +10887,12 @@
currentUserEmailParam: string,
hasViolations: boolean,
isASAPSubmitBetaEnabled: boolean,
expenseReportCurrentNextStepDeprecated: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>,
) {
if (!expenseReport) {
return;
}

const currentNextStepDeprecated = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`] ?? null;
const optimisticReopenedReportAction = buildOptimisticReopenedReportAction();
const predictedNextState = CONST.REPORT.STATE_NUM.OPEN;
const predictedNextStatus = CONST.REPORT.STATUS_NUM.OPEN;
Expand Down Expand Up @@ -10990,7 +10990,7 @@
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`,
value: currentNextStepDeprecated,
value: expenseReportCurrentNextStepDeprecated ?? null,
},
{
onyxMethod: Onyx.METHOD.MERGE,
Expand Down Expand Up @@ -11048,12 +11048,12 @@
currentUserEmailParam: string,
hasViolations: boolean,
isASAPSubmitBetaEnabled: boolean,
expenseReportCurrentNextStepDeprecated: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>,
) {
if (!expenseReport) {
return;
}

const currentNextStepDeprecated = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`] ?? null;
const optimisticRetractReportAction = buildOptimisticRetractedReportAction();
const predictedNextState = CONST.REPORT.STATE_NUM.OPEN;
const predictedNextStatus = CONST.REPORT.STATUS_NUM.OPEN;
Expand Down Expand Up @@ -11179,7 +11179,7 @@
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`,
value: currentNextStepDeprecated,
value: expenseReportCurrentNextStepDeprecated ?? null,
},
];

Expand Down Expand Up @@ -11222,13 +11222,12 @@
currentUserEmailParam: string,
hasViolations: boolean,
isASAPSubmitBetaEnabled: boolean,
expenseReportCurrentNextStepDeprecated: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>,
) {
if (isEmptyObject(expenseReport)) {
return;
}

const currentNextStepDeprecated = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`] ?? null;

const optimisticUnapprovedReportAction = buildOptimisticUnapprovedReportAction(expenseReport.total ?? 0, expenseReport.currency ?? '', expenseReport.reportID);

// buildOptimisticNextStep is used in parallel
Expand Down Expand Up @@ -11327,7 +11326,7 @@
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`,
value: currentNextStepDeprecated,
value: expenseReportCurrentNextStepDeprecated ?? null,
},
{
onyxMethod: Onyx.METHOD.MERGE,
Expand Down Expand Up @@ -11382,6 +11381,7 @@
currentUserEmailParam: string,
hasViolations: boolean,
isASAPSubmitBetaEnabled: boolean,
expenseReportCurrentNextStepDeprecated: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>,
) {
if (!expenseReport) {
return;
Expand All @@ -11391,7 +11391,6 @@
return;
}

const currentNextStepDeprecated = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`] ?? null;
const parentReport = getReportOrDraftReport(expenseReport.parentReportID);
const isCurrentUserManager = currentUserAccountIDParam === expenseReport.managerID;
const isSubmitAndClosePolicy = isSubmitAndClose(policy);
Expand Down Expand Up @@ -11521,7 +11520,7 @@
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`,
value: currentNextStepDeprecated,
value: expenseReportCurrentNextStepDeprecated ?? null,
},
];
failureData.push({
Expand Down Expand Up @@ -14842,9 +14841,16 @@
});
}

function assignReportToMe(report: OnyxTypes.Report, accountID: number, email: string, policy: OnyxEntry<OnyxTypes.Policy>, hasViolations: boolean, isASAPSubmitBetaEnabled: boolean) {
function assignReportToMe(
report: OnyxTypes.Report,
accountID: number,
email: string,
policy: OnyxEntry<OnyxTypes.Policy>,
hasViolations: boolean,
isASAPSubmitBetaEnabled: boolean,
reportCurrentNextStepDeprecated: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>,
) {
const takeControlReportAction = buildOptimisticChangeApproverReportAction(accountID, accountID);
const currentNextStepDeprecated = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${report?.reportID}`] ?? null;

// buildOptimisticNextStep is used in parallel
// eslint-disable-next-line @typescript-eslint/no-deprecated
Expand Down Expand Up @@ -14934,7 +14940,7 @@
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${report?.reportID}`,
value: currentNextStepDeprecated,
value: reportCurrentNextStepDeprecated ?? null,
},
],
};
Expand All @@ -14956,9 +14962,9 @@
policy: OnyxEntry<OnyxTypes.Policy>,
hasViolations: boolean,
isASAPSubmitBetaEnabled: boolean,
reportCurrentNextStepDeprecated: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>,
) {
const takeControlReportAction = buildOptimisticChangeApproverReportAction(newApproverAccountID, accountID);
const currentNextStepDeprecated = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${report?.reportID}`] ?? null;

// buildOptimisticNextStep is used in parallel
// eslint-disable-next-line @typescript-eslint/no-deprecated
Expand Down Expand Up @@ -15046,7 +15052,7 @@
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${report?.reportID}`,
value: currentNextStepDeprecated,
value: reportCurrentNextStepDeprecated ?? null,
},
],
};
Expand Down
2 changes: 2 additions & 0 deletions src/pages/ReportAddApproverPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function ReportAddApproverPage({report, isLoadingReportData, policy}: ReportAddA
const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
const currentUserDetails = useCurrentUserPersonalDetails();
const hasViolations = hasViolationsReportUtils(report?.reportID, transactionViolations, currentUserDetails.accountID, currentUserDetails.login ?? '');
const [reportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${report?.reportID}`, {canBeMissing: true});

const employeeList = policy?.employeeList;
const allApprovers = useMemo(() => {
Expand Down Expand Up @@ -95,6 +96,7 @@ function ReportAddApproverPage({report, isLoadingReportData, policy}: ReportAddA
policy,
hasViolations,
isASAPSubmitBetaEnabled,
reportNextStep,
);
Navigation.dismissModal();
}, [allApprovers, selectedApproverEmail, report, currentUserDetails.accountID, currentUserDetails.email, policy, hasViolations, isASAPSubmitBetaEnabled]);
Expand Down
Loading
Loading