Skip to content

Commit

Permalink
dlt the comment when it's empty
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-atg committed Aug 30, 2021
1 parent dafdef0 commit 96ec07c
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 96ec07c

Please sign in to comment.