From 8682227a3812546184bdf15de31e56c41f567fda Mon Sep 17 00:00:00 2001 From: Tsaqif Date: Sat, 28 Oct 2023 20:42:45 +0700 Subject: [PATCH 1/2] Fix avatar of the report action is not displayed properly if there is report preview action before it Signed-off-by: Tsaqif --- src/libs/ReportActionsUtils.ts | 5 +++++ src/pages/home/report/ReportActionItem.js | 1 + 2 files changed, 6 insertions(+) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 5d9b4fbdc9cf..e07d74cf352e 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -261,6 +261,11 @@ function isConsecutiveActionMadeByPreviousActor(reportActions: ReportAction[] | return false; } + // Do not group if report preview is the type of current or previous report action, but not both + if ((isReportPreviewAction(previousAction) && !isReportPreviewAction(currentAction)) || (isReportPreviewAction(currentAction) && !isReportPreviewAction(previousAction))) { + return false; + } + return currentAction.actorAccountID === previousAction.actorAccountID; } diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index d44c7b8ee4d1..0a2a144313da 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -760,6 +760,7 @@ export default compose( prevProps.shouldDisplayNewMarker === nextProps.shouldDisplayNewMarker && _.isEqual(prevProps.emojiReactions, nextProps.emojiReactions) && _.isEqual(prevProps.action, nextProps.action) && + _.isEqual(prevProps.iouReport, nextProps.iouReport) && _.isEqual(prevProps.report.pendingFields, nextProps.report.pendingFields) && _.isEqual(prevProps.report.isDeletedParentAction, nextProps.report.isDeletedParentAction) && _.isEqual(prevProps.report.errorFields, nextProps.report.errorFields) && From b2cd9a2dfb8aedb4246dabadee41d00cf014f7a5 Mon Sep 17 00:00:00 2001 From: Tsaqif Date: Sun, 29 Oct 2023 07:21:01 +0700 Subject: [PATCH 2/2] Fix comment of the grouping Signed-off-by: Tsaqif --- src/libs/ReportActionsUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index e07d74cf352e..bbf11b949aae 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -261,7 +261,7 @@ function isConsecutiveActionMadeByPreviousActor(reportActions: ReportAction[] | return false; } - // Do not group if report preview is the type of current or previous report action, but not both + // Do not group if one of previous / current action is report preview and another one is not report preview if ((isReportPreviewAction(previousAction) && !isReportPreviewAction(currentAction)) || (isReportPreviewAction(currentAction) && !isReportPreviewAction(previousAction))) { return false; }