<commit_before>import React from 'react';
import { Link } from 'react-router';
import NoteList from './sub/NoteList.jsx';
import LectureTitle from './sub/LectureTitle.jsx';
import Connection from '../Connection.js';
import {setRoomInfo} from '../actions/roomActions';
import Audio from './sub/Audio.jsx';

class Review extends React.Component {
  constructor (props) {
    super(props);
    this.state = {
      loaded: false
    };
  }
  componentWillMount() {
    var realm = this;
    var user = this.props.getState().user.information[0];
    var pathUrl = this.props.params.roomId;
    this.props.dispatch(setRoomInfo(pathUrl, user, (err, success) => {
      if (err) {
        realm.context.router.push('/notebook');
      } else {
        realm.setState({loaded: true});
      }
    }));
  }

  static get contextTypes() {
    return {
      router: React.PropTypes.object.isRequired,
    };
  }

  goToCompiledView() {
    this.context.router.push(`/compile/${this.props.getState().room.roomInfo.pathUrl}`);
  }

  render() {
    return (
      this.state.loaded ? (
      <div className="container">
        <LectureTitle />
        <NoteList />
        <button className="btn btn-md btn-primary" onClick={this.goToCompiledView.bind(this)}>
          Add / Edit Notes
        </button>
        <Audio />
      </div>
    ) : (<div></div>)
    );
  }
}

export default Connection(Review);<commit_msg>redux store connect review correctly<commit_after>import React from 'react';
import { Link } from 'react-router';
import NoteList from './sub/NoteList.jsx';
import LectureTitle from './sub/LectureTitle.jsx';
import {connect} from 'react-redux';
import {setRoomInfo} from '../actions/roomActions';
import Audio from './sub/Audio.jsx';
import UserReducer from '../reducers/userReducers';
import RoomReducer from '../reducers/roomReducers';
class Review extends React.Component {
  constructor (props) {
    super(props);
    this.state = {
      loaded: false
    };
  }
  componentWillMount() {
    var realm = this;
    var user = this.props.user.information[0];
    var pathUrl = this.props.params.roomId;
    this.props.dispatch(setRoomInfo(pathUrl, user, (err, success) => {
      if (err) {
        realm.context.router.push('/notebook');
      } else {
        realm.setState({loaded: true});
      }
    }));
  }

  static get contextTypes() {
    return {
      router: React.PropTypes.object.isRequired,
    };
  }

  goToCompiledView() {
    this.context.router.push(`/compile/${this.props.room.roomInfo.pathUrl}`);
  }

  render() {
    return (
      this.state.loaded ? (
      <div className="container">
        <LectureTitle />
        <NoteList />
        <button className="btn btn-md btn-primary" onClick={this.goToCompiledView.bind(this)}>
          Add / Edit Notes
        </button>
        <Audio />
      </div>
    ) : (<div></div>)
    );
  }
}

const mapStateToProps = (state) => {
  return {
    ...state,
    UserReducer,
    RoomReducer
  };
};

export default connect(mapStateToProps)(Review);
{'fraction_non_alphanumeric': 0.15214521452145213, 'fraction_numerical': 0.0006600660066006601, 'mean_word_length': 2.7144607843137254, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 24, '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': '3606226', 'n_tokens_mistral': 959, 'n_tokens_neox': 952, 'n_words': 194}