From 521530a7f222366c455132110367d296f1d7d446 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Wed, 9 Mar 2016 10:00:16 -0500
Subject: Disabled embed toggle when it's disabled in user settings

---
 .../components/post_body_additional_content.jsx      | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

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

diff --git a/web/react/components/post_body_additional_content.jsx b/web/react/components/post_body_additional_content.jsx
index c2a928f3b..70b3c8dbf 100644
--- a/web/react/components/post_body_additional_content.jsx
+++ b/web/react/components/post_body_additional_content.jsx
@@ -112,24 +112,32 @@ export default class PostBodyAdditionalContent extends React.Component {
     }
 
     render() {
-        var generateEmbed = this.generateEmbed();
+        const generateEmbed = this.generateEmbed();
+
         if (generateEmbed) {
-            return (
-                <div>
+            let toggle;
+            if (Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMBED_TOGGLE)) {
+                toggle = (
                     <a className='post__embed-visibility'
                         data-expanded={this.state.embedVisible}
                         aria-label='Toggle Embed Visibility'
                         onClick={this.toggleEmbedVisibility}
-                    >
-                    </a>
+                    />
+                );
+            }
+
+            return (
+                <div>
+                    {toggle}
                     <div className='post__embed-container'
                         hidden={!this.state.embedVisible}
                     >
                     {generateEmbed}
                     </div>
                 </div>
-                );
+            );
         }
+
         return null;
     }
 }
-- 
cgit v1.2.3-1-g7c22

