Skip to content

Commit

Permalink
Merge pull request Expensify#39908 from nkdengineer/fix/38187
Browse files Browse the repository at this point in the history
fix @expensify.sms is copied along with phone number
  • Loading branch information
youssef-lr authored Apr 15, 2024
2 parents 62acb01 + a2c3914 commit c5ea716
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ExpensiMark from 'expensify-common/lib/ExpensiMark';
import Str from 'expensify-common/lib/str';
import type {MutableRefObject} from 'react';
import React from 'react';
import {InteractionManager} from 'react-native';
Expand Down Expand Up @@ -388,7 +389,12 @@ const ContextMenuActions: ContextMenuAction[] = [
} else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.UNHOLD) {
Clipboard.setString(Localize.translateLocal('iou.unheldRequest'));
} else if (content) {
setClipboardMessage(content);
setClipboardMessage(
content.replace(/(<mention-user>)(.*?)(<\/mention-user>)/gi, (match, openTag, innerContent, closeTag): string => {
const modifiedContent = Str.removeSMSDomain(innerContent) || '';
return openTag + modifiedContent + closeTag || '';
}),
);
} else if (messageText) {
Clipboard.setString(messageText);
}
Expand Down

0 comments on commit c5ea716

Please sign in to comment.