<commit_before>import React from "react";

import { Overlay as OverlayFrame, Close } from "sajari-react/ui/Overlay";
import { State } from "sajari-react/pipeline/state";

import SearchResponse from "./SearchResponse";
import Input from "./Input";

const _state = State.default();

class Overlay extends React.Component {
  constructor(props) {
    super(props);
    let active = false;
    if (
      (props.config.values && props.config.values.q) ||
      (props.config.initialValues && props.config.initialValues.q)
    ) {
      active = true;
    }
    this.state = { active };
    this.setOverlayActive = this.setOverlayActive.bind(this);
  }

  setOverlayActive(active) {
    if (active) {
      if (this.state.active === false) {
        this.props.initialiseValues();
      }
    } else {
      _state.reset();
    }
    this.setState({ active });
    document.getElementsByTagName("body")[0].style.overflow = active
      ? "hidden"
      : "";<commit_msg>site-search-overlay: remove unnecessary state check<commit_after>import React from "react";

import { Overlay as OverlayFrame, Close } from "sajari-react/ui/Overlay";
import { State } from "sajari-react/pipeline/state";

import SearchResponse from "./SearchResponse";
import Input from "./Input";

const _state = State.default();

class Overlay extends React.Component {
  constructor(props) {
    super(props);
    let active = false;
    if (
      (props.config.values && props.config.values.q) ||
      (props.config.initialValues && props.config.initialValues.q)
    ) {
      active = true;
    }
    this.state = { active };
    this.setOverlayActive = this.setOverlayActive.bind(this);
  }

  setOverlayActive(active) {
    if (active) {
      this.props.initialiseValues();
    } else {
      _state.reset();
    }
    this.setState({ active });
    document.getElementsByTagName("body")[0].style.overflow = active
      ? "hidden"
      : "";
{'fraction_non_alphanumeric': 0.1398017736045905, 'fraction_numerical': 0.0010432968179447052, 'mean_word_length': 3.0721868365180467, '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': '7316651', 'n_tokens_mistral': 580, 'n_tokens_neox': 589, 'n_words': 121}