Skip to content

Commit

Permalink
Merge pull request #32676 from bernhardoj/fix/32285-submitted-action-…
Browse files Browse the repository at this point in the history
…copy-to-clipboard

Fix copying submitted message copies nothing
  • Loading branch information
lakchote authored Dec 11, 2023
2 parents 4f41819 + b7d159e commit 68e8ba2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ function isModifiedExpenseAction(reportAction: OnyxEntry<ReportAction>): boolean
return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE;
}

function isSubmittedExpenseAction(reportAction: OnyxEntry<ReportAction>): boolean {
return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.SUBMITTED;
}

function isWhisperAction(reportAction: OnyxEntry<ReportAction>): boolean {
return (reportAction?.whisperedToAccountIDs ?? []).length > 0;
}
Expand Down Expand Up @@ -693,6 +697,7 @@ export {
isDeletedParentAction,
isMessageDeleted,
isModifiedExpenseAction,
isSubmittedExpenseAction,
isMoneyRequestAction,
isNotifiableReportAction,
isPendingRemove,
Expand Down
3 changes: 3 additions & 0 deletions src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ export default [
} else if (ReportActionsUtils.isChannelLogMemberAction(reportAction)) {
const logMessage = ReportUtils.getChannelLogMemberMessage(reportAction);
Clipboard.setString(logMessage);
} else if (ReportActionsUtils.isSubmittedExpenseAction(reportAction)) {
const submittedMessage = _.reduce(reportAction.message, (acc, curr) => `${acc}${curr.text}`, '');
Clipboard.setString(submittedMessage);
} else if (content) {
const parser = new ExpensiMark();
if (!Clipboard.canSetHtml()) {
Expand Down

0 comments on commit 68e8ba2

Please sign in to comment.