mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
Merge pull request #1424 from mewtaylor/issue/double-api-call
key api calls on `username` check
This commit is contained in:
commit
931606c4d7
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ var Splash = injectIntl(React.createClass({
|
|||
},
|
||||
componentDidUpdate: function (prevProps) {
|
||||
if (this.props.user != prevProps.user) {
|
||||
if (this.props.user) {
|
||||
if (this.props.user.username) {
|
||||
this.getActivity(this.props.user.username);
|
||||
this.getSharedByFollowing(this.props.user.token);
|
||||
this.getInStudiosFollowing(this.props.user.token);
|
||||
|
@ -59,7 +59,7 @@ var Splash = injectIntl(React.createClass({
|
|||
},
|
||||
componentDidMount: function () {
|
||||
this.getFeaturedGlobal();
|
||||
if (this.props.user) {
|
||||
if (this.props.user.username) {
|
||||
this.getActivity(this.props.user.username);
|
||||
this.getSharedByFollowing(this.props.user.token);
|
||||
this.getInStudiosFollowing(this.props.user.token);
|
||||
|
|
Loading…
Reference in a new issue