Bug 1393148 - Hide Topics component if no topics available in Activity Stream draft bug1393148
authork88hudson <khudson@mozilla.com>
Wed, 23 Aug 2017 14:22:07 -0400
changeset 651434 bad5b1b1ba67b7768ca021c3220b83bc861e441c
parent 651395 c86b7150523c10e1d1dbc0be2d8ed96f205be35f
child 727714 1a40e180918b5eb834db1acaa8cfa78681da42cd
push id75728
push userkhudson@mozilla.com
push dateWed, 23 Aug 2017 18:22:57 +0000
bugs1393148
milestone57.0a1
Bug 1393148 - Hide Topics component if no topics available in Activity Stream MozReview-Commit-ID: 1WgTeCkrs58
browser/extensions/activity-stream/data/content/activity-stream.bundle.js
--- a/browser/extensions/activity-stream/data/content/activity-stream.bundle.js
+++ b/browser/extensions/activity-stream/data/content/activity-stream.bundle.js
@@ -2278,17 +2278,17 @@ class Section extends React.Component {
           emptyState = _props.emptyState,
           dispatch = _props.dispatch,
           maxRows = _props.maxRows,
           contextMenuOptions = _props.contextMenuOptions,
           intl = _props.intl;
 
     const maxCards = 3 * maxRows;
     const initialized = rows && rows.length > 0;
-    const shouldShowTopics = id === "TopStories" && this.props.topics && this.props.read_more_endpoint;
+    const shouldShowTopics = id === "TopStories" && this.props.topics && this.props.topics.length > 0 && this.props.read_more_endpoint;
 
     const infoOptionIconA11yAttrs = {
       "aria-haspopup": "true",
       "aria-controls": "info-option",
       "aria-expanded": this.state.infoActive ? "true" : "false",
       "role": "note",
       "tabIndex": 0
     };