Skip to content

Commit

Permalink
Merge pull request Expensify#30357 from DylanDylann/fix/28599-does-no…
Browse files Browse the repository at this point in the history
…t-trim-the-value-private-note

Fix/28599: Trim the draft private note
  • Loading branch information
MariaHCD authored Oct 30, 2023
2 parents e99c297 + b9d4d47 commit 84687b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -2420,7 +2420,7 @@ function clearPrivateNotesError(reportID, accountID) {
}

function getDraftPrivateNote(reportID) {
return draftNoteMap[reportID];
return draftNoteMap[reportID] || '';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PrivateNotes/PrivateNotesEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) {
// We need to edit the note in markdown format, but display it in HTML format
const parser = new ExpensiMark();
const [privateNote, setPrivateNote] = useState(
() => Report.getDraftPrivateNote(report.reportID) || parser.htmlToMarkdown(lodashGet(report, ['privateNotes', route.params.accountID, 'note'], '')).trim(),
() => Report.getDraftPrivateNote(report.reportID).trim() || parser.htmlToMarkdown(lodashGet(report, ['privateNotes', route.params.accountID, 'note'], '')).trim(),
);

/**
Expand Down

0 comments on commit 84687b8

Please sign in to comment.