Skip to content

Commit

Permalink
Merge pull request #22633 from hungvu193/fix-22304
Browse files Browse the repository at this point in the history
  • Loading branch information
flodnv authored Jul 12, 2023
2 parents eb66edf + 704589d commit 3585d7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,18 @@ export default [
// `ContextMenuItem` with `successText` and `successIcon` which will fallback to
// the `text` and `icon`
onPress: (closePopover, {reportAction, selection}) => {
const isReportPreviewAction = ReportActionUtils.isReportPreviewAction(reportAction);
const message = _.last(lodashGet(reportAction, 'message', [{}]));
const messageHtml = lodashGet(message, 'html', '');

const isAttachment = _.has(reportAction, 'isAttachment') ? reportAction.isAttachment : ReportUtils.isReportMessageAttachment(message);
if (!isAttachment) {
const content = selection || messageHtml;
if (content) {
if (isReportPreviewAction) {
const iouReport = ReportUtils.getReport(ReportActionUtils.getIOUReportIDFromReportActionPreview(reportAction));
const displayMessage = ReportUtils.getReportPreviewMessage(iouReport, reportAction);
Clipboard.setString(displayMessage);
} else if (content) {
const parser = new ExpensiMark();
if (!Clipboard.canSetHtml()) {
Clipboard.setString(parser.htmlToMarkdown(content));
Expand Down

0 comments on commit 3585d7b

Please sign in to comment.