Skip to content

Commit

Permalink
Merge pull request #4909 from aman-atg/aman-atg-editedBug
Browse files Browse the repository at this point in the history
dlt the comment when it's empty
  • Loading branch information
pecanoro authored Aug 30, 2021
2 parents 8de4463 + 96ec07c commit a3b2069
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,12 @@ function editReportComment(reportID, originalReportAction, textForNewComment) {
const parser = new ExpensiMark();
const htmlForNewComment = parser.replace(textForNewComment);

// Delete the comment if it's empty
if (_.isEmpty(htmlForNewComment)) {
deleteReportComment(reportID, originalReportAction);
return;
}

// Skip the Edit if message is not changed
if (originalReportAction.message[0].html === htmlForNewComment.trim()) {
return;
Expand Down

0 comments on commit a3b2069

Please sign in to comment.