Skip to content

Commit

Permalink
Merge pull request Expensify#21369 from Expensify/ionatan_uselsess_Ex…
Browse files Browse the repository at this point in the history
…pandURLPreview

Fix extractLinksFromMessageHtml so ExpandURLPreview is not called needlessly
  • Loading branch information
iwiznia authored Jun 26, 2023
2 parents 1bb5287 + d19b943 commit 48d4187
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportActionsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function getMostRecentIOURequestActionID(reportActions) {
* Returns array of links inside a given report action
*
* @param {Object} reportAction
* @returns {Boolean}
* @returns {Array}
*/
function extractLinksFromMessageHtml(reportAction) {
const htmlContent = lodashGet(reportAction, ['message', 0, 'html']);
Expand All @@ -191,7 +191,7 @@ function extractLinksFromMessageHtml(reportAction) {
const regex = /<a\s+(?:[^>]*?\s+)?href="([^"]*)"/gi;

if (!htmlContent) {
return;
return [];
}

return _.map([...htmlContent.matchAll(regex)], (match) => match[1]);
Expand Down

0 comments on commit 48d4187

Please sign in to comment.