I'm running this code in my react app:

```
  componentDidMount() {
    modelInstance.addObserver(this);
    modelInstance.getSignInStatus().then((user)=>{
      this.setState({
        userName: user !== false ? user.displayName : "Sign in",
        logged_in: user !== false ? true : false

      });
    });
  }

```

And here is modelInstance.getSignInStatus():

```
  this.getSignInStatus = function () {
    return new Promise((resolve, reject)=>{
      firebase.auth().onAuthStateChanged(function(user){
        if (user){
          resolve(user);
        }
        else {
          resolve(false);
        }
      });
    });
  }

```

What happens is that `this.state.userName` is set to `null`, meaning that `user.displayName` is `null`. Why is this?