Skip to content

Commit

Permalink
Merge pull request #36464 from Tony-MK/fix/35934
Browse files Browse the repository at this point in the history
fix/35934  | Workspaces - Сustom avatar is applied to all workspace rooms
  • Loading branch information
aldo-expensify authored Feb 20, 2024
2 parents 8538155 + add15f3 commit febfd3b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1475,9 +1475,11 @@ function getIconsForParticipants(participants: number[], personalDetails: OnyxCo
*/
function getWorkspaceIcon(report: OnyxEntry<Report>, policy: OnyxEntry<Policy> = null): Icon {
const workspaceName = getPolicyName(report, false, policy);
const policyExpenseChatAvatarSource = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar
? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar
: getDefaultWorkspaceAvatar(workspaceName);
const rootParentReport = getRootParentReport(report);
const hasCustomAvatar =
!(isEmptyObject(rootParentReport) || isDefaultRoom(rootParentReport) || isChatRoom(rootParentReport) || isArchivedRoom(rootParentReport)) &&
allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar;
const policyExpenseChatAvatarSource = hasCustomAvatar ? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar : getDefaultWorkspaceAvatar(workspaceName);

const workspaceIcon: Icon = {
source: policyExpenseChatAvatarSource ?? '',
Expand Down

0 comments on commit febfd3b

Please sign in to comment.