Skip to content

Commit

Permalink
Merge pull request #30688 from eh2077/30076-fix-private-note-draft-no…
Browse files Browse the repository at this point in the history
…t-cleanup-after-saving

fix: private note draft not cleanup after saving
  • Loading branch information
Li357 authored Nov 6, 2023
2 parents e6da3c6 + 3dc8403 commit d160f38
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/pages/PrivateNotes/PrivateNotesEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,15 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) {

const savePrivateNote = () => {
const originalNote = lodashGet(report, ['privateNotes', route.params.accountID, 'note'], '');
const editedNote = Report.handleUserDeletedLinksInHtml(privateNote.trim(), parser.htmlToMarkdown(originalNote).trim());
Report.updatePrivateNotes(report.reportID, route.params.accountID, editedNote);

if (privateNote.trim() !== originalNote.trim()) {
const editedNote = Report.handleUserDeletedLinksInHtml(privateNote.trim(), parser.htmlToMarkdown(originalNote).trim());
Report.updatePrivateNotes(report.reportID, route.params.accountID, editedNote);
}

// We want to delete saved private note draft after saving the note
debouncedSavePrivateNote('');

Keyboard.dismiss();

// Take user back to the PrivateNotesView page
Expand Down

0 comments on commit d160f38

Please sign in to comment.