Merge pull request #1424 from mewtaylor/issue/double-api-call

key api calls on `username` check
This commit is contained in:
Matthew Taylor 2017-07-20 15:16:24 -04:00 committed by GitHub
commit 931606c4d7

View file

@ -36,7 +36,7 @@ var Splash = injectIntl(React.createClass({
}, },
componentDidUpdate: function (prevProps) { componentDidUpdate: function (prevProps) {
if (this.props.user != prevProps.user) { if (this.props.user != prevProps.user) {
if (this.props.user) { if (this.props.user.username) {
this.getActivity(this.props.user.username); this.getActivity(this.props.user.username);
this.getSharedByFollowing(this.props.user.token); this.getSharedByFollowing(this.props.user.token);
this.getInStudiosFollowing(this.props.user.token); this.getInStudiosFollowing(this.props.user.token);
@ -59,7 +59,7 @@ var Splash = injectIntl(React.createClass({
}, },
componentDidMount: function () { componentDidMount: function () {
this.getFeaturedGlobal(); this.getFeaturedGlobal();
if (this.props.user) { if (this.props.user.username) {
this.getActivity(this.props.user.username); this.getActivity(this.props.user.username);
this.getSharedByFollowing(this.props.user.token); this.getSharedByFollowing(this.props.user.token);
this.getInStudiosFollowing(this.props.user.token); this.getInStudiosFollowing(this.props.user.token);