Skip to content

Commit b8f132f

Browse files
mountinyOSBotify
authored andcommitted
Merge pull request #79665 from Expensify/revert-78984-fix/77882
[CP Staging] Revert "fix: Submit button is not displayed in second report to Approver" (cherry picked from commit 1437722) (cherry-picked to staging by mountiny)
1 parent 765cf2c commit b8f132f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/libs/ReportPreviewActionUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ function canSubmit(
3737
const isExpense = isExpenseReport(report);
3838
const isSubmitter = isCurrentUserSubmitter(report);
3939
const isOpen = isOpenReport(report);
40-
const submitToAccountID = getSubmitToAccountID(policy, report);
41-
const isManager = submitToAccountID === currentUserAccountID || report.managerID === currentUserAccountID;
40+
const isManager = report.managerID === currentUserAccountID;
4241
const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
4342

4443
if (!!transactions && transactions?.length > 0 && transactions.every((transaction) => isPending(transaction))) {
@@ -51,6 +50,8 @@ function canSubmit(
5150
return false;
5251
}
5352

53+
const submitToAccountID = getSubmitToAccountID(policy, report);
54+
5455
if (submitToAccountID === report.ownerAccountID && policy?.preventSelfApproval) {
5556
return false;
5657
}

src/libs/ReportSecondaryActionUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function isSubmitAction({
216216

217217
const isReportSubmitter = isCurrentUserSubmitter(report);
218218
const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
219-
const isManager = getSubmitToAccountID(policy, report) === currentUserAccountID || report.managerID === currentUserAccountID;
219+
const isManager = report.managerID === getCurrentUserAccountID();
220220
if (!isReportSubmitter && !isAdmin && !isManager) {
221221
return false;
222222
}

0 commit comments

Comments
 (0)