From 1ce059b4d41346c6e1acf716cab2d114b1800125 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 20 Nov 2024 19:25:25 +0800 Subject: [PATCH] fix new message shows when creating a new expense --- src/libs/ReportUtils.ts | 1 + src/pages/home/report/ReportActionsList.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 373a861f7c2e..d40cdf8aea8a 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5172,6 +5172,7 @@ function buildOptimisticReportPreview( actorAccountID: hasReceipt ? currentUserAccountID : reportActorAccountID, childReportID: childReportID ?? iouReport?.reportID, childMoneyRequestCount: 1, + childLastActorAccountID: currentUserAccountID, childLastMoneyRequestComment: comment, childRecentReceiptTransactionIDs: hasReceipt && !isEmptyObject(transaction) ? {[transaction?.transactionID ?? '-1']: created} : undefined, }; diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 8ddea8e7e940..100585b6f818 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -281,7 +281,7 @@ function ReportActionsList({ } // If no unread marker exists, don't set an unread marker for newly added messages from the current user. - const isFromCurrentUser = accountID === (ReportActionsUtils.isReportPreviewAction(message) ? !message.childLastActorAccountID : message.actorAccountID); + const isFromCurrentUser = accountID === (ReportActionsUtils.isReportPreviewAction(message) ? message.childLastActorAccountID : message.actorAccountID); const isNewMessage = !prevSortedVisibleReportActionsObjects[message.reportActionID]; // The unread marker will show if the action's `created` time is later than `unreadMarkerTime`.