Skip to content

Commit

Permalink
Merge pull request #38221 from ishpaul777/fix/38153
Browse files Browse the repository at this point in the history
fixes enter click to select the authorized payer
  • Loading branch information
luacmartins authored Mar 13, 2024
2 parents 7656198 + 861118b commit cc3a905
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/pages/workspace/workflows/WorkspaceWorkflowsPayerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ function WorkspaceWorkflowsPayerPage({route, policy, policyMembers, personalDeta
sectionsArray.push({
data: formattedAuthorizedPayer,
shouldShow: true,
indexOffset: formattedPolicyAdmins.length,
indexOffset: 0,
});

sectionsArray.push({
title: translate('workflowsPayerPage.admins'),
data: formattedPolicyAdmins,
shouldShow: true,
indexOffset: 0,
indexOffset: formattedAuthorizedPayer.length,
});
return sectionsArray;
}, [formattedPolicyAdmins, formattedAuthorizedPayer, translate, searchTerm]);
Expand All @@ -170,13 +170,12 @@ function WorkspaceWorkflowsPayerPage({route, policy, policyMembers, personalDeta

const setPolicyAuthorizedPayer = (member: MemberOption) => {
const authorizedPayerEmail = personalDetails?.[member.accountID]?.login ?? '';
if (policy?.reimburserEmail === authorizedPayerEmail) {
return;
}

if (policy?.reimbursementChoice !== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES) {
if (policy?.reimburserEmail === authorizedPayerEmail || policy?.reimbursementChoice !== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES) {
Navigation.goBack();
return;
}

const authorizedPayerAccountID = member.accountID;
Policy.setWorkspacePayer(policy?.id ?? '', authorizedPayerEmail, authorizedPayerAccountID);
Navigation.goBack();
Expand Down

0 comments on commit cc3a905

Please sign in to comment.