<commit_before>class NavigationBar extends React.Component {

  constructor(props) {
    super(props);
    this.state= {
      invitationsList: [],
      showDropDown: false
    }
    this.updateInvitations = this.updateInvitations.bind(this)
    this._toggleDropDown = this._toggleDropDown.bind(this);
  }

  componentWillMount() {
    let self = this;
    $.ajax({
      method: "GET",
      url: "http://localhost:3000/games/get_invitations",
      success: function(data) {
        self.setState({invitationsList: data})
      }
    })
  }

  componentDidMount() {
    this._setupSubscription();
  }

  updateInvitations(data) {
    console.log(data);
    if(data.deleted){
      this.setState({invitationsList: this.state.invitationsList.filter( invitation => {invitation.game_id != data.game_id})});
    }else{
      this.setState({invitationsList: this.state.invitationsList.concat([data])});<commit_msg>Fixes in navigation bar if there is no currentUser<commit_after>class NavigationBar extends React.Component {

  constructor(props) {
    super(props);
    this.state= {
      invitationsList: [],
      showDropDown: false
    }
    this.updateInvitations = this.updateInvitations.bind(this)
    this._toggleDropDown = this._toggleDropDown.bind(this);
  }

  componentWillMount() {
    if(!this.props.currentUser) return;
    let self = this;
    $.ajax({
      method: "GET",
      url: "http://localhost:3000/games/get_invitations",
      success: function(data) {
        self.setState({invitationsList: data})
      }
    })
  }

  componentDidMount() {
    if(!this.props.currentUser) return;
    this._setupSubscription();
  }

  updateInvitations(data) {
    console.log(data);
    if(data.deleted){
      this.setState({invitationsList: this.state.invitationsList.filter( invitation => {invitation.game_id != data.game_id})});
    }else{
      this.setState({invitationsList: this.state.invitationsList.concat([data])});
{'fraction_non_alphanumeric': 0.1361526560082517, 'fraction_numerical': 0.0041258380608561115, 'mean_word_length': 3.419134396355353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6438049', 'n_tokens_mistral': 601, 'n_tokens_neox': 594, 'n_words': 91}