<commit_before>import 'es6-symbol/implement';
import {Provider} from 'react-redux';
import store from './src/redux/store';
import AppViewContainer from './src/modules/AppViewContainer';
import React from 'react';
import {setConfiguration} from './src/utils/configuration';
import {AppRegistry, BackAndroid} from 'react-native';
import * as NavigationStateActions from './src/modules/navigation/NavigationState';

const Hemmo = React.createClass({

  componentWillMount() {
    BackAndroid.addEventListener('hardwareBackPress', this.navigateBack);
    setConfiguration('API_ROOT', 'http://hemmo-backend.herokuapp.com');
    // setConfiguration('API_ROOT', 'http://localhost:3001');
  },

  navigateBack() {
    const navigationState = store.getState().get('navigationState');

    if (navigationState.get('index') === 0) {
      return false;
    }

    /* Check if returning from current page is allowed */
    var currentPageIndex = navigationState.get('index');
    var allowReturn = navigationState.getIn(['children', currentPageIndex, 'allowReturn']);
    if (allowReturn === false) {
      return true;
    }

    store.dispatch(NavigationStateActions.popRoute());
    return true;
  },

  render() {
    return (
      <Provider store={store}>
        <AppViewContainer />
      </Provider><commit_msg>Set backend to production backend<commit_after>import 'es6-symbol/implement';
import {Provider} from 'react-redux';
import store from './src/redux/store';
import AppViewContainer from './src/modules/AppViewContainer';
import React from 'react';
import {setConfiguration} from './src/utils/configuration';
import {AppRegistry, BackAndroid} from 'react-native';
import * as NavigationStateActions from './src/modules/navigation/NavigationState';

const Hemmo = React.createClass({

  componentWillMount() {
    BackAndroid.addEventListener('hardwareBackPress', this.navigateBack);
    setConfiguration('API_ROOT', 'http://hemmo.pelastakaalapset.fi');
    // setConfiguration('API_ROOT', 'http://localhost:3001');
  },

  navigateBack() {
    const navigationState = store.getState().get('navigationState');

    if (navigationState.get('index') === 0) {
      return false;
    }

    /* Check if returning from current page is allowed */
    var currentPageIndex = navigationState.get('index');
    var allowReturn = navigationState.getIn(['children', currentPageIndex, 'allowReturn']);
    if (allowReturn === false) {
      return true;
    }

    store.dispatch(NavigationStateActions.popRoute());
    return true;
  },

  render() {
    return (
      <Provider store={store}>
        <AppViewContainer />
      </Provider>
{'fraction_non_alphanumeric': 0.13933181473044798, 'fraction_numerical': 0.004555808656036446, 'mean_word_length': 4.228174603174603, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4354313', 'n_tokens_mistral': 729, 'n_tokens_neox': 712, 'n_words': 165}