From 43ea6661411f3994ef0a28d32ca187dc3dbca7e5 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Wed, 21 Oct 2015 14:12:34 -0400 Subject: [PATCH] Get project count from api when logged out --- src/components/intro/intro.jsx | 1 + src/views/splash/splash.jsx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/components/intro/intro.jsx b/src/components/intro/intro.jsx index ff201dbe2..b27329ceb 100644 --- a/src/components/intro/intro.jsx +++ b/src/components/intro/intro.jsx @@ -3,6 +3,7 @@ var React = require('react'); var ReactIntl = require('react-intl'); var FormattedMessage = ReactIntl.FormattedMessage; var FormattedHTMLMessage = ReactIntl.FormattedHTMLMessage; + var Modal = require('../modal/modal.jsx'); require('./intro.scss'); diff --git a/src/views/splash/splash.jsx b/src/views/splash/splash.jsx index d3f978255..91cc3baee 100644 --- a/src/views/splash/splash.jsx +++ b/src/views/splash/splash.jsx @@ -52,6 +52,7 @@ var Splash = injectIntl(React.createClass({ this.getNews(); } else { this.setState({featuredCustom: []}); + this.getProjectCount(); } } }, @@ -61,6 +62,8 @@ var Splash = injectIntl(React.createClass({ this.getActivity(); this.getCustomHomepageRows(); this.getNews(); + } else { + this.getProjectCount(); } }, getNews: function () { @@ -77,6 +80,13 @@ var Splash = injectIntl(React.createClass({ if (!err) this.setState({'activity': body}); }.bind(this)); }, + getProjectCount: function () { + this.api({ + uri: '/projects/count/all' + }, function (err, body) { + if (!err) this.setState({projectCount: body.count}); + }.bind(this)); + }, renderHomepageRows: function () { var formatMessage = this.props.intl.formatMessage; var rows = [