key api calls on username check

`this.props.user` will now return `true` because there is a default user object that’s empty. So, instead, wait for an actual user object
This commit is contained in:
Matthew Taylor 2017-07-20 15:01:36 -04:00
parent b2db8cbac8
commit d0e7c29b5f

View file

@ -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);