<commit_before>import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { setChartAction } from '../actions/chartActions';
import Button from './Button';

class ProfilePage extends React.Component {
  constructor(props){
    super(props);
    this.logoff = this.logoff.bind(this);
  }

  logoff(){
    localStorage.setItem('token', '');
    this.props.logout();
    this.props.history.push('/login');
  }

  render(){
    return (
      <div className="center">
        <h1>Profile Page</h1>
        <Button cb={this.logoff} msg="Log Off"/>
      </div>
    );
  }
}
ProfilePage.propTypes = {
  logout: PropTypes.func,
  history: PropTypes.object
};
const mapStateToProps = () => {
  return {
    token: localStorage.token
  };
};
const mapDispatchToProps = dispatch => {
return {
    logout: () => dispatch(setChartAction([]))
  };
};

export default connect(mapStateToProps, mapDispatchToProps)(ProfilePage);<commit_msg>(fear) logging off now works with toastr<commit_after>import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { setChartAction } from '../actions/chartActions';
import Button from './Button';

class ProfilePage extends React.Component {
  constructor(props){
    super(props);
    this.logoff = this.logoff.bind(this);
  }

  logoff(){
    localStorage.token = '';
    toastr.success('You are now logged off');
    this.props.logout();
    this.props.history.push('/login');
  }

  render(){
    return (
      <div className="center">
        <h1>Profile Page</h1>
        <Button cb={this.logoff} msg="Log Off"/>
      </div>
    );
  }
}
ProfilePage.propTypes = {
  logout: PropTypes.func,
  history: PropTypes.object
};
const mapStateToProps = () => {
  return {
    token: localStorage.token
  };
};
const mapDispatchToProps = dispatch => {
return {
    logout: () => {
      return dispatch(setChartAction([]));
    }
  };
};

export default connect(mapStateToProps, mapDispatchToProps)(ProfilePage);
{'fraction_non_alphanumeric': 0.15620291310899045, 'fraction_numerical': 0.0020090406830738324, 'mean_word_length': 3.4563758389261743, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '2204051', 'n_tokens_mistral': 618, 'n_tokens_neox': 620, 'n_words': 131}