From 1a7bbcf0251a76c234b326b1fee2936e02d99d3e Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 11 Jul 2023 17:18:49 -0700 Subject: [PATCH] Fix unrelated tests --- src/libs/actions/Report.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index f53e07475aad..8c072d8c7bc8 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -26,6 +26,7 @@ import * as Welcome from './Welcome'; import * as PersonalDetailsUtils from '../PersonalDetailsUtils'; import SidebarUtils from '../SidebarUtils'; import * as OptionsListUtils from '../OptionsListUtils'; +import * as Localize from '../Localize'; let currentUserAccountID; Onyx.connect({ @@ -243,7 +244,14 @@ function addActions(reportID, text = '', file) { const currentTime = DateUtils.getDBTime(); - const prevVisibleMessageText = ReportActionsUtils.getLastVisibleMessageText(reportID); + const lastVisibleMessage = ReportActionsUtils.getLastVisibleMessage(reportID); + let prevVisibleMessageText; + if (lastVisibleMessage.lastMessageTranslationKey) { + prevVisibleMessageText = Localize.translateLocal(prevVisibleMessageText); + } else { + prevVisibleMessageText = lastVisibleMessage.lastMessageText; + } + const lastCommentText = ReportUtils.formatReportLastMessageText(lastAction.message[0].text); const optimisticReport = {