Merge pull request #2577 from LLK/develop

Merge #2569 and #2567 to master
This commit is contained in:
Ray Schamp 2019-01-03 11:43:19 -05:00 committed by GitHub
commit b9bfb007e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 15 deletions

View file

@ -609,7 +609,6 @@ SplashPresentation.defaultProps = {
inStudiosFollowing: [], // "Projects in Studios I'm Following" inStudiosFollowing: [], // "Projects in Studios I'm Following"
lovedByFollowing: [], // "Projects Loved by Scratchers I'm Following" lovedByFollowing: [], // "Projects Loved by Scratchers I'm Following"
news: [], // gets news posts from the scratch Tumblr news: [], // gets news posts from the scratch Tumblr
projectCount: 20000000, // gets the shared project count
sharedByFollowing: [] // "Projects by Scratchers I'm Following" sharedByFollowing: [] // "Projects by Scratchers I'm Following"
}; };

View file

@ -17,7 +17,6 @@ class Splash extends React.Component {
super(props); super(props);
bindAll(this, [ bindAll(this, [
'getNews', 'getNews',
'getProjectCount',
'handleRefreshHomepageCache', 'handleRefreshHomepageCache',
'getHomepageRefreshStatus', 'getHomepageRefreshStatus',
'handleShowEmailConfirmationModal', 'handleShowEmailConfirmationModal',
@ -30,7 +29,6 @@ class Splash extends React.Component {
]); ]);
this.state = { this.state = {
adminPanelOpen: false, adminPanelOpen: false,
projectCount: 30000000, // gets the shared project count
news: [], // gets news posts from the scratch Tumblr news: [], // gets news posts from the scratch Tumblr
emailConfirmationModalOpen: false, // flag that determines whether to show banner to request email conf. emailConfirmationModalOpen: false, // flag that determines whether to show banner to request email conf.
refreshCacheStatus: 'notrequested' refreshCacheStatus: 'notrequested'
@ -44,8 +42,6 @@ class Splash extends React.Component {
this.props.getInStudiosFollowing(this.props.user.username, this.props.user.token); this.props.getInStudiosFollowing(this.props.user.username, this.props.user.token);
this.props.getLovedByFollowing(this.props.user.username, this.props.user.token); this.props.getLovedByFollowing(this.props.user.username, this.props.user.token);
this.getNews(); this.getNews();
} else {
this.getProjectCount();
} }
} }
componentDidUpdate (prevProps) { componentDidUpdate (prevProps) {
@ -62,7 +58,6 @@ class Splash extends React.Component {
this.props.setRows('studios', []); this.props.setRows('studios', []);
this.props.setRows('activity', []); this.props.setRows('activity', []);
this.setState({news: []}); // eslint-disable-line react/no-did-update-set-state this.setState({news: []}); // eslint-disable-line react/no-did-update-set-state
this.getProjectCount();
} }
if (this.shouldShowEmailConfirmation()) { if (this.shouldShowEmailConfirmation()) {
window.addEventListener('message', this.onMessage); window.addEventListener('message', this.onMessage);
@ -82,14 +77,6 @@ class Splash extends React.Component {
if (!err) return this.setState({news: body}); if (!err) return this.setState({news: body});
}); });
} }
getProjectCount () {
api({
uri: '/projects/count/all'
}, (err, body) => {
if (!body) return log.error('No response body');
if (!err) return this.setState({projectCount: body.count});
});
}
handleRefreshHomepageCache () { handleRefreshHomepageCache () {
api({ api({
host: '', host: '',
@ -173,7 +160,6 @@ class Splash extends React.Component {
isEducator={this.props.isEducator} isEducator={this.props.isEducator}
lovedByFollowing={this.props.loved} lovedByFollowing={this.props.loved}
news={this.state.news} news={this.state.news}
projectCount={this.state.projectCount}
refreshCacheStatus={homepageRefreshStatus} refreshCacheStatus={homepageRefreshStatus}
sessionStatus={this.props.sessionStatus} sessionStatus={this.props.sessionStatus}
sharedByFollowing={this.props.shared} sharedByFollowing={this.props.shared}