From 6d09d06c04686073be1ff46ab00e77814e3e5680 Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Fri, 4 Dec 2015 12:25:05 -0800
Subject: PLT-1355 Move link preview into pre-release feature

---
 web/react/components/post_body.jsx | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'web/react/components/post_body.jsx')

diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index 3e335b901..296b9e7d7 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -6,6 +6,7 @@ import UserStore from '../stores/user_store.jsx';
 import * as Utils from '../utils/utils.jsx';
 import * as Emoji from '../utils/emoticons.jsx';
 import Constants from '../utils/constants.jsx';
+const PreReleaseFeatures = Constants.PRE_RELEASE_FEATURES;
 import * as TextFormatting from '../utils/text_formatting.jsx';
 import twemoji from 'twemoji';
 import PostBodyAdditionalContent from './post_body_additional_content.jsx';
@@ -109,12 +110,14 @@ export default class PostBody extends React.Component {
 
         const trimmedLink = link.trim();
 
-        const provider = this.getOembedProvider(trimmedLink);
-        if (provider != null) {
-            post.props.oEmbedLink = trimmedLink;
-            post.type = 'oEmbed';
-            this.setState({post, provider});
-            return '';
+        if (Utils.isFeatureEnabled(PreReleaseFeatures.EMBED_PREVIEW)) {
+            const provider = this.getOembedProvider(trimmedLink);
+            if (provider != null) {
+                post.props.oEmbedLink = trimmedLink;
+                post.type = 'oEmbed';
+                this.setState({post, provider});
+                return '';
+            }
         }
 
         const embed = this.createYoutubeEmbed(link);
-- 
cgit v1.2.3-1-g7c22

