diff --git a/src/libs/Permissions.js b/src/libs/Permissions.js index fc97436eddcb..f80f1878fc36 100644 --- a/src/libs/Permissions.js +++ b/src/libs/Permissions.js @@ -110,6 +110,14 @@ function canUseDistanceRequests(betas) { return _.contains(betas, CONST.BETAS.DISTANCE_REQUESTS) || canUseAllBetas(betas); } +/** + * Link previews are temporarily disabled. + * @returns {Boolean} + */ +function canUseLinkPreviews() { + return false; +} + export default { canUseChronos, canUsePayWithExpensify, @@ -123,4 +131,5 @@ export default { canUseScanReceipts, canUseCustomStatus, canUseDistanceRequests, + canUseLinkPreviews, }; diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 3aa9113351c2..d182dc4c6bc3 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -64,6 +64,7 @@ import * as PersonalDetailsUtils from '../../../libs/PersonalDetailsUtils'; import ReportActionItemBasicMessage from './ReportActionItemBasicMessage'; import * as store from '../../../libs/actions/ReimbursementAccount/store'; import * as BankAccounts from '../../../libs/actions/BankAccounts'; +import Permissions from '../../../libs/Permissions'; const propTypes = { ...windowDimensionsPropTypes, @@ -155,6 +156,10 @@ function ReportActionItem(props) { }, [isDraftEmpty]); useEffect(() => { + if (!Permissions.canUseLinkPreviews()) { + return; + } + const urls = ReportActionsUtils.extractLinksFromMessageHtml(props.action); if (_.isEqual(downloadedPreviews.current, urls) || props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) { return; @@ -382,7 +387,7 @@ function ReportActionItem(props) { return ( <> {children} - {!isHidden && !_.isEmpty(props.action.linkMetadata) && ( + {Permissions.canUseLinkPreviews() && !isHidden && !_.isEmpty(props.action.linkMetadata) && ( !_.isEmpty(item))} />