<commit_before>import React from 'react';
import Dialog from 'rc-dialog';
function noop() {
}

export default React.createClass({
  getInitialState() {
    return {
      visible: false,
      confirmLoading: false
    };
  },

  handleCancel() {
    var d = this.refs.d;
    d.requestClose();
  },

  getDefaultProps() {
    return {
      prefixCls: 'ant-modal',
      onOk: noop,
      onCancel: noop
    };
  },

  handleOk() {
    this.setState({
      confirmLoading: true
    });
    if (typeof this.props.onOk) {
      this.props.onOk();
    }
  },

  componentWillReceiveProps(nextProps) {
    if ('visible' in nextProps) {
      // 隐藏后去除按钮 loading 效果
      if (!nextProps.visible) {
        this.setState({
          confirmLoading: false
        });<commit_msg>fix boolean expression always true<commit_after>import React from 'react';
import Dialog from 'rc-dialog';
function noop() {
}

export default React.createClass({
  getInitialState() {
    return {
      visible: false,
      confirmLoading: false
    };
  },

  handleCancel() {
    var d = this.refs.d;
    d.requestClose();
  },

  getDefaultProps() {
    return {
      prefixCls: 'ant-modal',
      onOk: noop,
      onCancel: noop
    };
  },

  handleOk() {
    this.setState({
      confirmLoading: true
    });
    if (typeof this.props.onOk === 'function') {
      this.props.onOk();
    }
  },

  componentWillReceiveProps(nextProps) {
    if ('visible' in nextProps) {
      // 隐藏后去除按钮 loading 效果
      if (!nextProps.visible) {
        this.setState({
          confirmLoading: false
        });
{'fraction_non_alphanumeric': 0.13227848101265824, 'fraction_numerical': 0.0, 'mean_word_length': 2.286902286902287, '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': '6243422', 'n_tokens_mistral': 520, 'n_tokens_neox': 525, 'n_words': 111}