Skip to content

Commit

Permalink
Merge pull request #36070 from FitseTLT/fix-reimbursementqueued-copy-…
Browse files Browse the repository at this point in the history
…to-clipboard
  • Loading branch information
francoisl authored Feb 29, 2024
2 parents 6f035f0 + 2d8b6c5 commit 99fcead
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1722,8 +1722,8 @@ function getDeletedParentActionMessageForChatReport(reportAction: OnyxEntry<Repo
*
*/
function getReimbursementQueuedActionMessage(reportAction: OnyxEntry<ReportAction>, report: OnyxEntry<Report>): string {
const submitterDisplayName = getDisplayNameForParticipant(report?.ownerAccountID, true) ?? '';
function getReimbursementQueuedActionMessage(reportAction: OnyxEntry<ReportAction>, report: OnyxEntry<Report>, shouldUseShortDisplayName = true): string {
const submitterDisplayName = getDisplayNameForParticipant(report?.ownerAccountID, shouldUseShortDisplayName) ?? '';
const originalMessage = reportAction?.originalMessage as IOUMessage | undefined;
let messageKey: TranslationPaths;
if (originalMessage?.paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import * as Report from '@userActions/Report';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ROUTES from '@src/ROUTES';
import type {Beta, ReportAction, ReportActionReactions} from '@src/types/onyx';
import type {Beta, ReportAction, ReportActionReactions, Report as ReportType} from '@src/types/onyx';
import type IconAsset from '@src/types/utils/IconAsset';
import {hideContextMenu, showDeleteModal} from './ReportActionContextMenu';

Expand Down Expand Up @@ -367,6 +367,8 @@ const ContextMenuActions: ContextMenuAction[] = [
} else if (ReportActionsUtils.isMemberChangeAction(reportAction)) {
const logMessage = ReportActionsUtils.getMemberChangeMessageFragment(reportAction).html ?? '';
setClipboardMessage(logMessage);
} else if (ReportActionsUtils.isReimbursementQueuedAction(reportAction)) {
Clipboard.setString(ReportUtils.getReimbursementQueuedActionMessage(reportAction, ReportUtils.getReport(reportID) as OnyxEntry<ReportType>, false));
} else if (ReportActionsUtils.isActionableMentionWhisper(reportAction)) {
const mentionWhisperMessage = ReportActionsUtils.getActionableMentionWhisperMessage(reportAction);
setClipboardMessage(mentionWhisperMessage);
Expand Down

0 comments on commit 99fcead

Please sign in to comment.