Skip to content

Commit

Permalink
Merge pull request #21895 from Expensify/cristi_refactor-duplicated-code
Browse files Browse the repository at this point in the history
Reuse logic for policy name and workspace avatar
  • Loading branch information
Julesssss authored Jun 30, 2023
2 parents 3404111 + f3c9e23 commit 282ee2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,9 @@ function getIcons(report, personalDetails, defaultIcon = null, isPayer = false,
return [result];
}
if (isPolicyExpenseChat(report) || isExpenseReport(report)) {
const workspaceName = lodashGet(allPolicies, [`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`, 'name']);
const workspaceName = getPolicyName(report);

const policyExpenseChatAvatarSource = lodashGet(allPolicies, [`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`, 'avatar']) || getDefaultWorkspaceAvatar(workspaceName);
const policyExpenseChatAvatarSource = getWorkspaceAvatar(report);

// Return the workspace avatar if the user is the owner of the policy expense chat
if (report.isOwnPolicyExpenseChat && !isExpenseReport(report)) {
Expand Down

0 comments on commit 282ee2c

Please sign in to comment.