From 570fca19074416339effd210f5328aebc97afba1 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Sep 2023 12:15:46 +0200 Subject: [PATCH 1/2] Correctly display workspace for Money requests --- src/pages/home/report/ReportActionItemSingle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 80f49f177b6f..60ffcdbc071a 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -92,7 +92,8 @@ function ReportActionItemSingle(props) { let {displayName} = props.personalDetailsList[actorAccountID] || {}; const {avatar, login, pendingFields, status} = props.personalDetailsList[actorAccountID] || {}; let actorHint = (login || displayName || '').replace(CONST.REGEX.MERGED_ACCOUNT_PREFIX, ''); - const isWorkspaceActor = ReportUtils.isPolicyExpenseChat(props.report) && !actorAccountID; + const displayAllActors = useMemo(() => props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && props.iouReport, [props.action.actionName, props.iouReport]); + const isWorkspaceActor = ReportUtils.isPolicyExpenseChat(props.report) && (!actorAccountID || displayAllActors); let avatarSource = UserUtils.getAvatar(avatar, actorAccountID); if (isWorkspaceActor) { @@ -111,7 +112,6 @@ function ReportActionItemSingle(props) { // If this is a report preview, display names and avatars of both people involved let secondaryAvatar = {}; - const displayAllActors = useMemo(() => props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && props.iouReport, [props.action.actionName, props.iouReport]); const primaryDisplayName = displayName; if (displayAllActors) { const secondaryUserDetails = props.personalDetailsList[props.iouReport.ownerAccountID] || {}; From 8601daf1bd1ce4c3841c4dbd79b84a5a0106faa4 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Sep 2023 12:22:08 +0200 Subject: [PATCH 2/2] do not display wrong email on avatar --- src/pages/home/report/ReportActionItemSingle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 60ffcdbc071a..155f261693b5 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -126,7 +126,7 @@ function ReportActionItemSingle(props) { } else if (!isWorkspaceActor) { secondaryAvatar = ReportUtils.getIcons(props.report, {})[props.report.isOwnPolicyExpenseChat ? 0 : 1]; } - const icon = {source: avatarSource, type: isWorkspaceActor ? CONST.ICON_TYPE_WORKSPACE : CONST.ICON_TYPE_AVATAR, name: primaryDisplayName, id: actorAccountID}; + const icon = {source: avatarSource, type: isWorkspaceActor ? CONST.ICON_TYPE_WORKSPACE : CONST.ICON_TYPE_AVATAR, name: primaryDisplayName, id: isWorkspaceActor ? '' : actorAccountID}; // Since the display name for a report action message is delivered with the report history as an array of fragments // we'll need to take the displayName from personal details and have it be in the same format for now. Eventually,