Adapt loading detection

This commit is contained in:
Chi Vinh Le
2017-08-18 17:57:32 +07:00
parent fabc8b8c46
commit 6a5f6e3ce1
3 changed files with 7 additions and 3 deletions
@@ -108,7 +108,7 @@ class UserDetailContainer extends React.Component {
return null;
}
const loading = [1, 2, 4].indexOf(this.props.data.networkStatus) >= 0;
const loading = this.props.data.loading;
return <UserDetail
bulkReject={this.bulkReject}
@@ -145,7 +145,11 @@ class StreamContainer extends React.Component {
}
render() {
if (this.props.refetching) {
if (this.props.refetching
|| !this.props.root.asset
|| !this.props.root.asset.comment
&& !this.props.root.asset.comments
) {
return <Spinner />;
}
return <Stream
@@ -53,7 +53,7 @@ class ProfileContainer extends Component {
render() {
const {auth, auth: {user}, asset, showSignInDialog, stopIgnoringUser} = this.props;
const {me} = this.props.root;
const loading = [1, 2, 4].indexOf(this.props.data.networkStatus) >= 0;
const loading = this.props.data.loading;
if (!auth.loggedIn) {
return <NotLoggedIn showSignInDialog={showSignInDialog} />;