@@ -66,8 +66,19 @@ function buildNextStepMessage(nextStep: ReportNextStep, translate: LocaleContext
6666}
6767
6868function buildOptimisticNextStep ( params : BuildNextStepNewParams ) : ReportNextStep | null {
69- const { report, policy, currentUserAccountIDParam, currentUserEmailParam, hasViolations, isASAPSubmitBetaEnabled, predictedNextStatus, shouldFixViolations, isUnapprove, isReopen, bypassNextApproverID} =
70- params ;
69+ const {
70+ report,
71+ policy,
72+ currentUserAccountIDParam,
73+ currentUserEmailParam,
74+ hasViolations,
75+ isASAPSubmitBetaEnabled,
76+ predictedNextStatus,
77+ shouldFixViolations,
78+ isUnapprove,
79+ isReopen,
80+ bypassNextApproverID,
81+ } = params ;
7182
7283 if ( ! isExpenseReport ( report ) ) {
7384 return null ;
@@ -336,8 +347,19 @@ function buildOptimisticNextStepForStrictPolicyRuleViolations() {
336347 * @deprecated This function will be removed soon. You should still use it though but also use buildOptimisticNextStep in parallel.
337348 */
338349function buildNextStepNew ( params : BuildNextStepNewParams ) : ReportNextStepDeprecated | null {
339- const { report, policy, currentUserAccountIDParam, currentUserEmailParam, hasViolations, isASAPSubmitBetaEnabled, predictedNextStatus, shouldFixViolations, isUnapprove, isReopen, bypassNextApproverID} =
340- params ;
350+ const {
351+ report,
352+ policy,
353+ currentUserAccountIDParam,
354+ currentUserEmailParam,
355+ hasViolations,
356+ isASAPSubmitBetaEnabled,
357+ predictedNextStatus,
358+ shouldFixViolations,
359+ isUnapprove,
360+ isReopen,
361+ bypassNextApproverID,
362+ } = params ;
341363
342364 if ( ! isExpenseReport ( report ) ) {
343365 return null ;
@@ -365,7 +387,9 @@ function buildNextStepNew(params: BuildNextStepNewParams): ReportNextStepDepreca
365387 policyOwnerPersonalDetails ?. displayName ??
366388 policyOwnerPersonalDetails ?. login ??
367389 getDisplayNameForParticipant ( { accountID : policy ?. ownerAccountID , formatPhoneNumber : formatPhoneNumberPhoneUtils } ) ;
368- const nextApproverDisplayName = bypassNextApproverID ? getDisplayNameForParticipant ( { accountID : bypassNextApproverID , formatPhoneNumber : formatPhoneNumberPhoneUtils } ) ?? getPersonalDetailsForAccountID ( bypassNextApproverID ) . login : getNextApproverDisplayName ( report , isUnapprove ) ;
390+ const nextApproverDisplayName = bypassNextApproverID
391+ ? ( getDisplayNameForParticipant ( { accountID : bypassNextApproverID , formatPhoneNumber : formatPhoneNumberPhoneUtils } ) ?? getPersonalDetailsForAccountID ( bypassNextApproverID ) . login )
392+ : getNextApproverDisplayName ( report , isUnapprove ) ;
369393 const approverAccountID = bypassNextApproverID ?? getNextApproverAccountID ( report , isUnapprove ) ;
370394 const approvers = getLoginsByAccountIDs ( [ approverAccountID ?? CONST . DEFAULT_NUMBER_ID ] ) ;
371395
0 commit comments