<commit_before>const ipcRenderer = window.require('electron').ipcRenderer;
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { loadLogins } from './actions.js';

import configureStore from './store/configureStore';

import 'app.css';

const initialStore = window.require('remote').getGlobal('initialStoreState');
const store = configureStore(initialStore);

ipcRenderer.on('manage-accounts', () => {
//  store.dispatch(push('/accounts'));
});

let prevState = store.getState();
store.subscribe(() => {
  const state = store.getState();
  if (prevState.logins !== state.logins) {
    ipcRenderer.send('save-accounts', state.logins);
  }
  if (prevState.tabs !== state.tabs) {
    ipcRenderer.send('save-tabs', state.tabs);
  }
});

// Makes sure react-ui's touch events work
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();

import MainWindow from './pages/MainWindow.jsx';

const Entry = () => (
  <Provider store={store}>
    <MainWindow />
  </Provider>
);

render(<Entry />, document.getElementById('content'));<commit_msg>filter out response data so its not saved<commit_after>const ipcRenderer = window.require('electron').ipcRenderer;
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { loadLogins } from './actions.js';

import configureStore from './store/configureStore';

import 'app.css';

const initialStore = window.require('remote').getGlobal('initialStoreState');
const store = configureStore(initialStore);

ipcRenderer.on('manage-accounts', () => {
//  store.dispatch(push('/accounts'));
});

let prevState = store.getState();
store.subscribe(() => {
  const state = store.getState();
  if (prevState.logins !== state.logins) {
    ipcRenderer.send('save-accounts', state.logins);
  }
  if (prevState.tabs !== state.tabs) {
    ipcRenderer.send('save-tabs', state.tabs.map((tab) => {
      return Object.keys(tab).reduce((data, fieldName) => {
        /* filter out response data */
        if (fieldName !== 'response') {
          data[fieldName] = tab[fieldName];
        }
        return data;
      }, {});
    }));
  }
});

// Makes sure react-ui's touch events work
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();

import MainWindow from './pages/MainWindow.jsx';

const Entry = () => (
  <Provider store={store}>
    <MainWindow />
  </Provider>
);

render(<Entry />, document.getElementById('content'));
{'fraction_non_alphanumeric': 0.17077045274027006, 'fraction_numerical': 0.0, 'mean_word_length': 4.336864406779661, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1943197', 'n_tokens_mistral': 770, 'n_tokens_neox': 756, 'n_words': 166}