diff --git a/src/languages/en.js b/src/languages/en.js index ab85d453cee5..64abc25e063d 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -56,6 +56,7 @@ export default { send: 'Send', notifications: 'Notifications', noResultsFound: 'No results found', + deletedCommentMessage: 'Comment deleted', }, attachmentPicker: { cameraPermissionRequired: 'Camera Permission Required', diff --git a/src/languages/es.js b/src/languages/es.js index 31c7df2275d4..42dd0cb674dd 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -52,6 +52,7 @@ export default { send: 'Enviar', notifications: 'Notificaciones', noResultsFound: 'No se han encontrado resultados', + deletedCommentMessage: 'Comentario borrado', }, attachmentPicker: { cameraPermissionRequired: 'Se necesita permiso para usar la cámara', diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 15ccf5c6405d..ac7f8b6aa4b1 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -166,7 +166,7 @@ function getSimplifiedReportObject(report) { // We convert the line-breaks in html to space ' ' before striping the tags const lastMessageText = lodashGet(lastReportAction, ['message', 'html'], '') .replace(/((]*>)+)/gi, ' ') - .replace(/(<([^>]+)>)/gi, ''); + .replace(/(<([^>]+)>)/gi, '') || `[${translateLocal('common.deletedCommentMessage')}]`; const reportName = lodashGet(report, ['reportNameValuePairs', 'type']) === 'chat' ? getChatReportName(report, chatType) : report.reportName; @@ -504,7 +504,7 @@ function updateReportActionMessage(reportID, sequenceNumber, message) { // If this is the most recent message, update the lastMessageText in the report object as well if (sequenceNumber === reportMaxSequenceNumbers[reportID]) { Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, { - lastMessageText: message.html, + lastMessageText: message.html || `[${translateLocal('common.deletedCommentMessage')}]`, }); } }