<commit_before>var EditorHeader = React.createClass({
  _onUpdateName: function() {
    this.props.onUpdateName &&
      this.props.onUpdateName(this.refs.nameInput.getDOMNode().value);
  },

  _handleOnSubmit: function(e) {
    e.preventDefault();

    if (this.belongsToCurrentUser()) {
      this._onSave(e);
    } else {
      this._onFork(e);
    }
  },

  _onSave: function(e) {
    e.preventDefault();
    this.props.onSave && this.props.onSave();
  },

  _onFork: function(e) {
    e.preventDefault();
    this.props.onFork && this.props.onFork();
  },

  _onPick: function(e) {
    e.preventDefault();
    this.props.onPick && this.props.onPick();
  },

  _onUpdateBuild: function(value) {
    this.props.onUpdateBuild &&
      this.props.onUpdateBuild(value);
  },

  belongsToCurrentUser: function() {
    return (
      this.props.currentUser &&
      this.props.currentUser.id == this.props.play.creatorId
    )
  },

  currentUserIsAdmin: function() {
    return this.props.currentUser.admin;
  },

  renderPickButton: function() {<commit_msg>Fix bug when currentUser is not defined<commit_after>var EditorHeader = React.createClass({
  _onUpdateName: function() {
    this.props.onUpdateName &&
      this.props.onUpdateName(this.refs.nameInput.getDOMNode().value);
  },

  _handleOnSubmit: function(e) {
    e.preventDefault();

    if (this.belongsToCurrentUser()) {
      this._onSave(e);
    } else {
      this._onFork(e);
    }
  },

  _onSave: function(e) {
    e.preventDefault();
    this.props.onSave && this.props.onSave();
  },

  _onFork: function(e) {
    e.preventDefault();
    this.props.onFork && this.props.onFork();
  },

  _onPick: function(e) {
    e.preventDefault();
    this.props.onPick && this.props.onPick();
  },

  _onUpdateBuild: function(value) {
    this.props.onUpdateBuild &&
      this.props.onUpdateBuild(value);
  },

  belongsToCurrentUser: function() {
    return (
      this.props.currentUser &&
      this.props.currentUser.id == this.props.play.creatorId
    )
  },

  currentUserIsAdmin: function() {
    return this.props.currentUser && this.props.currentUser.admin;
  },

  renderPickButton: function() {
{'fraction_non_alphanumeric': 0.1505078485687904, 'fraction_numerical': 0.0, 'mean_word_length': 3.111954459203036, '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': '3745440', 'n_tokens_mistral': 753, 'n_tokens_neox': 734, 'n_words': 99}