<commit_before>var screenfull = require('screenfull');

var FullscreenMixin = {

  getInitialState: function() {
    return {
      hasFullscreen: false
    };
  },

  componentDidMount: function () {
    var enabled = screenfull.enabled;

    if (enabled) {
      document.addEventListener(screenfull.raw.fullscreenchange, this.onChangeFullscreen);

      this.setState({
        hasFullscreen: enabled
      });
    }<commit_msg>Check if fullscreen is already enabled on mount<commit_after>var screenfull = require('screenfull');

var FullscreenMixin = {

  getInitialState: function() {
    return {
      hasFullscreen: false
    };
  },

  componentDidMount: function () {
    var enabled = screenfull.enabled;

    if (enabled) {
      document.addEventListener(screenfull.raw.fullscreenchange, this.onChangeFullscreen);

      this.setState({
        hasFullscreen: enabled,
        isFullscreen: screenfull.isFullscreen,
        fullScreenElement: screenfull.element
      });
    }
{'fraction_non_alphanumeric': 0.10101010101010101, 'fraction_numerical': 0.0, 'mean_word_length': 3.1991525423728815, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6040664', 'n_tokens_mistral': 279, 'n_tokens_neox': 271, 'n_words': 55}