From 9292c0d3bbdc1d0ed04593e224b69ff75363a906 Mon Sep 17 00:00:00 2001 From: mkzie2 Date: Tue, 26 Nov 2024 06:22:58 +0700 Subject: [PATCH] fix: report policy avatar is not updated --- src/libs/ReportUtils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 952e0c2fe4cc..1ba2777515d5 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2052,9 +2052,8 @@ function getWorkspaceIcon(report: OnyxInputOrEntry, policy?: OnyxInputOr const workspaceName = getPolicyName(report, false, policy); const cacheKey = report?.policyID ?? workspaceName; const iconFromCache = workSpaceIconsCache.get(cacheKey); - // disabling to protect against empty strings - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - const policyAvatarURL = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatarURL || report?.policyAvatar; + const reportPolicy = policy ?? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; + const policyAvatarURL = reportPolicy ? reportPolicy?.avatarURL : report?.policyAvatar; // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const policyExpenseChatAvatarSource = policyAvatarURL || getDefaultWorkspaceAvatar(workspaceName);