<commit_before>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import Chat from '../Chat/components/Chat';

// Import Style
import styles from './App.css';

// Import Components
import Helmet from 'react-helmet';
import DevTools from './components/DevTools';
import Header from './components/Header/Header';
import Footer from './components/Footer/Footer';

// Import Actions
import { toggleAddPost, updateCurrentChatUser } from './AppActions';
import { switchLanguage } from '../../modules/Intl/IntlActions';
import { authUser, logoutUser, fetchUsers } from '../User/UserActions';

export class App extends Component {
  constructor(props) {
    super(props);
    this.state = { isMounted: false };
  }

  componentDidMount() {
    this.setState({isMounted: true}); // eslint-disable-line
    this.props.dispatch(authUser());
  }

  toggleAddPostSection = () => {
    this.props.dispatch(toggleAddPost());
  };

  render() {

    return (
      <div>
        {this.state.isMounted && !window.devToolsExtension && process.env.NODE_ENV === 'development' && <DevTools />}
        <div>
          <Helmet
            title="MERN Starter - Blog App"
            titleTemplate="%s - BBP"
            meta={[
              { charset: 'utf-8' },
              {
                'http-equiv': 'X-UA-Compatible',
                content: 'IE=edge',
              },
              {
                name: 'viewport',
                content: 'width=device-width, initial-scale=1',
              },
            ]}
          />
          <Header
            switchLanguage={lang => this.props.dispatch(switchLanguage(lang))}
            intl={this.props.intl}
            toggleAddPost={this.toggleAddPostSection}
            avatar={this.props.user.avatar}
            isGuide={this.props.user.user ? this.props.user.user.isGuide : null}
            isLoggedIn={this.props.user.loggedIn}
            cuid={this.props.user.user ? this.props.user.user.cuid : null}
            logoutUser={() => this.props.dispatch(logoutUser())}
            chat={() => this.props.dispatch({ type: 'server/send_message', message: 'Hello there. This is a messäge.', receivers: ['123'] })}
          />
          <div className={styles.container}>
            {this.props.children}
          </div>
          <Footer />
        </div>
          <Chat
              updateCurrentChatUser={this.props.updateCurrentChatUser}
              fetchUsers={this.props.fetchUsers}
              usersFetching={this.props.usersFetching}
              usersPayload={this.props.usersPayload}
              usersFailed={this.props.usersFailed}
          />
      </div>
    );
  }
}

App.propTypes = {
  children: PropTypes.object.isRequired,
  dispatch: PropTypes.func.isRequired,
  intl: PropTypes.object.isRequired,
};

// Retrieve data from store as props
function mapStateToProps(store) {
  return {
    intl: store.intl,
    user: store.user,
    currentChatUser: store.app.currentChatUser,
    usersFetching: store.user.usersFetching,
    usersPayload: store.user.usersPayload,
    usersFailed: store.user.usersFailed
  };
}

const mapDispatchToProps = (dispatch) => {
  return {
    updateCurrentChatUser: (userCuid) => dispatch(updateCurrentChatUser(userCuid)),
    fetchUsers: () => dispatch(fetchUsers())
  }
};

export default connect(mapStateToProps, mapDispatchToProps)(App);<commit_msg>changed isOnline to be in UserActions<commit_after>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import Chat from '../Chat/components/Chat';

// Import Style
import styles from './App.css';

// Import Components
import Helmet from 'react-helmet';
import DevTools from './components/DevTools';
import Header from './components/Header/Header';
import Footer from './components/Footer/Footer';

// Import Actions
import { toggleAddPost, updateCurrentChatUser } from './AppActions';
import { switchLanguage } from '../../modules/Intl/IntlActions';
import { authUser, logoutUser, fetchUsers } from '../User/UserActions';

export class App extends Component {
  constructor(props) {
    super(props);
    this.state = { isMounted: false };
  }

  componentDidMount() {
    this.setState({isMounted: true}); // eslint-disable-line
    this.props.dispatch(authUser());
  }

  toggleAddPostSection = () => {
    this.props.dispatch(toggleAddPost());
  };

  render() {

    return (
      <div>
        {this.state.isMounted && !window.devToolsExtension && process.env.NODE_ENV === 'development' && <DevTools />}
        <div>
          <Helmet
            title="MERN Starter - Blog App"
            titleTemplate="%s - BBP"
            meta={[
              { charset: 'utf-8' },
              {
                'http-equiv': 'X-UA-Compatible',
                content: 'IE=edge',
              },
              {
                name: 'viewport',
                content: 'width=device-width, initial-scale=1',
              },
            ]}
          />
          <Header
            switchLanguage={lang => this.props.dispatch(switchLanguage(lang))}
            intl={this.props.intl}
            toggleAddPost={this.toggleAddPostSection}
            avatar={this.props.user.avatar}
            isGuide={this.props.user.user ? this.props.user.user.isGuide : null}
            isLoggedIn={this.props.user.loggedIn}
            cuid={this.props.user.user ? this.props.user.user.cuid : null}
            logoutUser={() => this.props.dispatch(logoutUser())}
            chat={() => this.props.dispatch({ type: 'server/send_message', message: 'Hello there. This is a messäge.', receivers: ['123'] })}
          />
          <div className={styles.container}>
            {this.props.children}
          </div>
          <Footer />
        </div>
          <Chat
              updateCurrentChatUser={this.props.updateCurrentChatUser}
              fetchUsers={this.props.fetchUsers}
              usersFetching={this.props.usersFetching}
              usersPayload={this.props.usersPayload}
              usersFailed={this.props.usersFailed}
          />
      </div>
    );
  }
}

App.propTypes = {
  children: PropTypes.object.isRequired,
  dispatch: PropTypes.func.isRequired,
  intl: PropTypes.object.isRequired,
};

// Retrieve data from store as props
function mapStateToProps(store) {
  return {
    intl: store.intl,
    user: store.user,
    currentChatUser: store.app.currentChatUser,
    usersFetching: store.user.usersFetching,
    usersPayload: store.user.usersPayload,
    usersFailed: store.user.usersFailed
  };
}

function mapDispatchToProps(dispatch) {
  return {
    updateCurrentChatUser: (userCuid) => dispatch(updateCurrentChatUser(userCuid)),
    fetchUsers: () => dispatch(fetchUsers())
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(App);
{'fraction_non_alphanumeric': 0.13636363636363635, 'fraction_numerical': 0.001466275659824047, 'mean_word_length': 2.4328132863613487, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 38, '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': '1327364', 'n_tokens_mistral': 1975, 'n_tokens_neox': 1963, 'n_words': 367}