<commit_before>class GroupShow extends React.Component {
  constructor () {
    super()
    this.state = {
      title: null,
      adminId: null,
      activeMembers: [],
      members: [],
      hangoutId: null,
      inHangout: false,
      centerPoint: '',
      currentEmail: null,
      errors: null
    }
    this.joinHangout = this.joinHangout.bind(this)
    this.createHangout = this.createHangout.bind(this)
  }

  handleInvite (event) {
    event.preventDefault()
    let form = this
    if (this.state.currentEmail) {
      let request = $.ajax({
        type: 'POST',
        url: '/groups/' + form.props.groupId + '/members',
        data: {currentEmail: this.state.currentEmail}
      })
      request.success((response) => {
        $('#member-list').append('<div>' + response.username + '</div>')
      })
      request.fail((response) => {
        var error = response.responseJSON['errors']
        form.setState({
          errors: error,
          currentEmail: null
        })
      })
    }
    $("input[type='email']").val('')
  }

  handleEmailChange (event) {
    this.setState({
      currentEmail: event.target.value
    })
  }

  addMembers () {
    if (this.props.sessionID) {
      return (
        <div className='card group-content'>
          <div className='card-header'>
            <button className='btn btn-default' type='button' data-toggle='collapse' data-target='#collapseExample' aria-expanded='false' aria-controls='collapseExample'>
            Add Users
            </button>
            <div id='collapseExample' className='card-body text-center collapse'>
              <div className='well'>
                <form action='/users' method='post'>
                  <div className='errors errors-container'>
                    {this.state.errors}
                  </div>
                  <div className='form-group'>
                    <input type='email' name='email' onChange={this.handleEmailChange.bind(this)} className='form-control' placeholder='<EMAIL>' />
                  </div>
                  <div className='register-btn'>
                    <button onClick={this.handleInvite.bind(this)} className='btn btn-default'>Invite User</button>
                  </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      )
    }
  }

  memberIsHanging (member) {
    if (this.state.activeMembers) {
      if (this.state.activeMembers.includes(member)) {
        return (<commit_msg>fixes bug with reloading restaurants<commit_after>class GroupShow extends React.Component {
  constructor () {
    super()
    this.state = {
      title: null,
      adminId: null,
      activeMembers: [],
      members: [],
      hangoutId: null,
      inHangout: false,
      centerPoint: '',
      currentEmail: null,
      errors: null
    }
    this.joinHangout = this.joinHangout.bind(this)
    this.createHangout = this.createHangout.bind(this)
  }

  handleInvite (event) {
    event.preventDefault()
    let form = this
    if (this.state.currentEmail) {
      let request = $.ajax({
        type: 'POST',
        url: '/groups/' + form.props.groupId + '/members',
        data: {currentEmail: this.state.currentEmail}
      })
      request.success((response) => {
        $('#member-list').append('<div>' + response.username + '</div>')
      })
      request.fail((response) => {
        var error = response.responseJSON['errors']
        form.setState({
          errors: error,
          currentEmail: null
        })
      })
    }
    $("input[type='email']").val('')
  }


  addMembers () {
    function handleEmailChange (event) {
      this.setState({
        currentEmail: event.target.value
      })
    }
    if (this.props.sessionID) {
      return (
        <div className='card group-content'>
          <div className='card-header'>
            <button className='btn btn-default' type='button' data-toggle='collapse' data-target='#collapseExample' aria-expanded='false' aria-controls='collapseExample'>
            Add Users
            </button>
            <div id='collapseExample' className='card-body text-center collapse'>
              <div className='well'>
                <form action='/users' method='post'>
                  <div className='errors errors-container'>
                    {this.state.errors}
                  </div>
                  <div className='form-group'>
                    <input type='email' name='email' onChange={this.handleEmailChange} className='form-control' placeholder='<EMAIL>' />
                  </div>
                  <div className='register-btn'>
                    <button onClick={this.handleInvite.bind(this)} className='btn btn-default'>Invite User</button>
                  </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      )
    }
  }

  memberIsHanging (member) {
    if (this.state.activeMembers) {
      if (this.state.activeMembers.includes(member)) {
        return (
{'fraction_non_alphanumeric': 0.14137587238285146, 'fraction_numerical': 0.0, 'mean_word_length': 1.9316189362945646, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 55, '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': '1556362', 'n_tokens_mistral': 1400, 'n_tokens_neox': 1366, 'n_words': 263}