Skip to content

Commit beb3037

Browse files
committed
fixes
1 parent 48787e5 commit beb3037

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hooks/useOptimisticNextStep.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import useTransactionsAndViolationsForReport from './useTransactionsAndViolation
3030
function useOptimisticNextStep(reportID: string | undefined) {
3131
const theme = useTheme();
3232
const {isOffline} = useNetwork();
33-
const {accountID, email} = useCurrentUserPersonalDetails();
33+
const {accountID, email, login: currentUserLogin} = useCurrentUserPersonalDetails();
3434
const {areStrictPolicyRulesEnabled} = useStrictPolicyRules();
3535

3636
const [moneyRequestReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
@@ -75,7 +75,7 @@ function useOptimisticNextStep(reportID: string | undefined) {
7575
optimisticNextStep = buildOptimisticNextStepForDEWOffline();
7676
}
7777
} else if (moneyRequestReport?.statusNum === CONST.REPORT.STATUS_NUM.SUBMITTED) {
78-
const gbrResult = getReasonAndReportActionThatRequiresAttention(moneyRequestReport, email ?? '', accountID, undefined, isArchivedReport);
78+
const gbrResult = getReasonAndReportActionThatRequiresAttention(moneyRequestReport, currentUserLogin ?? '', accountID, undefined, isArchivedReport);
7979
const hasDEWApproveFailed = gbrResult?.reason === CONST.REQUIRES_ATTENTION_REASONS.HAS_DEW_APPROVE_FAILED;
8080
const isCurrentUserTheApprover = moneyRequestReport?.managerID === accountID;
8181
if (hasDEWApproveFailed && isCurrentUserTheApprover) {

0 commit comments

Comments
 (0)