<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

// Controller view which manages the top level immutable state for the app

const React = require('react')
const Immutable = require('immutable')
const WindowStore = require('../stores/windowStore')
const AppStore = require('../stores/AppStore')
const Main = require('./main')

class Window extends React.Component {
  constructor () {
    super()
    this.state = {
      immutableData: {
        windowState: WindowStore.getState(),
        appState: AppStore.getState()
      }
    }
    WindowStore.addChangeListener(this.onChange.bind(this))
    AppStore.addChangeListener(this.onChange.bind(this))
  }

  render () {
    return <div id='windowContainer'>
      <Main browser={this.state.immutableData.windowState} app={this.state.immutableData.appState} />
    </div>
  }

  componentWillUnmount () {
    WindowStore.removeChangeListener(this.onChange.bind(this))
  }

  shouldComponentUpdate (nextProps, nextState) {
    return !Immutable.is(nextState.immutableData, this.state.immutableData)
  }

  onChange () {
    this.setState({
      immutableData: {
        windowState: WindowStore.getState(),
        appState: AppStore.getState()
      }
    })
  }

}

module.exports = Window
<commit_msg>Fix linux builds<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

// Controller view which manages the top level immutable state for the app

const React = require('react')
const Immutable = require('immutable')
const WindowStore = require('../stores/windowStore')
const AppStore = require('../stores/appStore')
const Main = require('./main')

class Window extends React.Component {
  constructor () {
    super()
    this.state = {
      immutableData: {
        windowState: WindowStore.getState(),
        appState: AppStore.getState()
      }
    }
    WindowStore.addChangeListener(this.onChange.bind(this))
    AppStore.addChangeListener(this.onChange.bind(this))
  }

  render () {
    return <div id='windowContainer'>
      <Main browser={this.state.immutableData.windowState} app={this.state.immutableData.appState} />
    </div>
  }

  componentWillUnmount () {
    WindowStore.removeChangeListener(this.onChange.bind(this))
  }

  shouldComponentUpdate (nextProps, nextState) {
    return !Immutable.is(nextState.immutableData, this.state.immutableData)
  }

  onChange () {
    this.setState({
      immutableData: {
        windowState: WindowStore.getState(),
        appState: AppStore.getState()
      }
    })
  }

}

module.exports = Window

{'fraction_non_alphanumeric': 0.12110605530276514, 'fraction_numerical': 0.00280014000700035, 'mean_word_length': 3.350076103500761, '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': '5735589', 'n_tokens_mistral': 860, 'n_tokens_neox': 858, 'n_words': 204}