<commit_before>import React, { Component } from 'react';
import Twitch from '../config/Twitch';
import StreamLink from './StreamLink';


class StreamsList extends Component {

  constructor(props) {
    super(props);
        this.state = {
          shouldHide: false,
          isToggleOn: true
        };
        this.onClick = this.onClick.bind(this);
        this.handleClick = this.handleClick.bind(this);
    }

  onClick() {
      console.log("onclick");
        if(!this.state.shouldHide){
          this.setState({
            shouldHide: true 
          })
        }else{
          this.setState({
            shouldHide: false 
          })
        }
      this.handleClick();
  }
  handleClick() {
    this.setState(prevState => ({
      isToggleOn: !prevState.isToggleOn
      }));
    }
  getGameStreams() {
    var game = this.props.params.query;
    fetch('https://api.twitch.tv/kraken/streams/?game=' + game, {
      method: 'GET',
      headers: {
        'Accept': 'application/vnd.twitchtv.v5+json',
        'Client-ID': Twitch.clientID
      }
    })
    .then(response => response.json())
    .then(json => {
      console.log(json.streams);
      this.setState({streams: json.streams })
    })
  }

  componentWillMount() {
    this.getGameStreams();
  }

  streamsList = () => {
      if (this.state.streams) {
          const streams = this.state.streams.map((stream) =>
            <li><StreamLink addStreamToCanvas={this.props.addStreamToCanvas} key={stream.channel._id} stream={stream}/></li>
        );
        return (<ul>{streams}</ul>)
      }

  }

  render() {

    return (
      
      <div>
        <button onClick={this.onClick} >{this.state.isToggleOn ? <i className="fa">&#xf102;</i> : <i className="fa">&#xf103;</i>}</button>
        <div className={this.state.shouldHide ? 'hidden' : ''}>
          <div className="streamList">
            {this.streamsList()}
          </div>
        </div>

      </div>
    )

  }
}

module.exports = StreamsList;
<commit_msg>accidentally deleted a line from a previous fix<commit_after>import React, { Component } from 'react';
import Twitch from '../config/Twitch';
import StreamLink from './StreamLink';


class StreamsList extends Component {

  constructor(props) {
    super(props);
        this.state = {
          shouldHide: false,
          isToggleOn: true
        };
        this.onClick = this.onClick.bind(this);
        this.handleClick = this.handleClick.bind(this);
    }

  onClick() {
      console.log("onclick");
        if(!this.state.shouldHide){
          this.setState({
            shouldHide: true 
          })
        }else{
          this.setState({
            shouldHide: false 
          })
        }
      this.handleClick();
  }
  handleClick() {
    this.setState(prevState => ({
      isToggleOn: !prevState.isToggleOn
      }));
    }
  getGameStreams() {
    var game = this.props.params.query;
    fetch('https://api.twitch.tv/kraken/streams/?game=' + game, {
      method: 'GET',
      headers: {
        'Accept': 'application/vnd.twitchtv.v5+json',
        'Client-ID': Twitch.clientID
      }
    })
    .then(response => response.json())
    .then(json => {
      console.log(json.streams);
      this.setState({streams: json.streams })
    })
  }

  componentWillMount() {
    this.getGameStreams();
  }

  streamsList = () => {
      if (this.state.streams) {
          const streams = this.state.streams.map((stream) =>
            <li><StreamLink addStreamToCanvas={this.props.addStreamToCanvas} stream={stream}/></li>
        );
        return (<ul>{streams}</ul>)
      }

  }

  render() {

    return (
      
      <div>
        <button onClick={this.onClick} >{this.state.isToggleOn ? <i className="fa">&#xf102;</i> : <i className="fa">&#xf103;</i>}</button>
        <div className={this.state.shouldHide ? 'hidden' : ''}>
          <div className="streamList">
            {this.streamsList()}
          </div>
        </div>

      </div>
    )

  }
}

module.exports = StreamsList;

{'fraction_non_alphanumeric': 0.15899477481960686, 'fraction_numerical': 0.0034834535954217467, 'mean_word_length': 2.094688221709007, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 47, 'https://': 2, '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': '348870', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1260, 'n_words': 200}