<commit_before>import Appconfig from '../appconfig';
import React from 'react';
import Router from 'react-router';
import { RouteHandler } from 'react-router';
import UserActions from '../actions/UserActions';

var App = React.createClass({
  mixins: [Router.Navigation],

  componentWillMount() {
    if (!Appconfig.authRequired) return;

    Appconfig.firebaseRef.onAuth((jsonUser) => {
      if (jsonUser) {
        UserActions.loggedIn(jsonUser);
        this.transitionTo('index');
      } else {
        UserActions.loggedOut();
        this.transitionTo('login');
      }
    });
  },

  render() {
    return <RouteHandler />;
  },
});

export default App;
<commit_msg>Fix race condition for transitions<commit_after>import Appconfig from '../appconfig';
import React from 'react';
import Router from 'react-router';
import { RouteHandler } from 'react-router';
import UserActions from '../actions/UserActions';

var App = React.createClass({
  mixins: [Router.Navigation],

  componentWillMount() {
    if (!Appconfig.authRequired) return;

    Appconfig.firebaseRef.onAuth((jsonUser) => {
      if (jsonUser) {
        UserActions.loggedIn(jsonUser);
        setTimeout(() => {
          this.transitionTo('index');
        }, 0);
      } else {
        UserActions.loggedOut();
        this.transitionTo('login');
      }
    });
  },

  render() {
    return <RouteHandler />;
  },
});

export default App;

{'fraction_non_alphanumeric': 0.14517265680056377, 'fraction_numerical': 0.0007047216349541931, 'mean_word_length': 3.1040462427745665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '2728554', 'n_tokens_mistral': 419, 'n_tokens_neox': 412, 'n_words': 92}