<commit_before>import Ember from "ember";
import ENV from '../config/environment';

export default Ember.ObjectController.extend({
  isEditing: false,
  closed: Ember.computed.not('opened'),
  url: function() {
    if (ENV.APP.API_HOST) {
      return ENV.APP.API_HOST + '/download/' + this.get('name');
    } else {
      return 'download/' + this.get('name');
    }
  }.property(name),
  actions: {
    edit: function() {
      this.set('isEditing', true);
    },
    saveChanges: function() {
      this.set('isEditing', false);
      this.get('model').save();
    },
    discardChanges: function() {
      this.set('isEditing', false);
      this.get('model').rollback();
    },
    open: function () {
      this.set('opened', true);
      var controller = this;
      var file = this.get('model');
      file.save().then( function(file) {
        if (! file.get('opened')) {
          return;
        }

        var stream = file.get('stream');
        if (stream !== null) {
          controller.transitionToRoute('stream', stream);
        }
      });
    },
    close: function () {
      this.set('opened', false);
      var file = this.get('model');
      file.save();
    }
  }
});
<commit_msg>Remove close function in file controller<commit_after>import Ember from "ember";
import ENV from '../config/environment';

export default Ember.ObjectController.extend({
  isEditing: false,
  closed: Ember.computed.not('opened'),
  url: function() {
    if (ENV.APP.API_HOST) {
      return ENV.APP.API_HOST + '/download/' + this.get('name');
    } else {
      return 'download/' + this.get('name');
    }
  }.property(name),
  actions: {
    edit: function() {
      this.set('isEditing', true);
    },
    saveChanges: function() {
      this.set('isEditing', false);
      this.get('model').save();
    },
    discardChanges: function() {
      this.set('isEditing', false);
      this.get('model').rollback();
    },
    open: function () {
      this.set('opened', true);
      var controller = this;
      var file = this.get('model');
      file.save().then( function(file) {
        if (! file.get('opened')) {
          return;
        }

        var stream = file.get('stream');
        if (stream !== null) {
          controller.transitionToRoute('stream', stream);
        }
      });
    }
  }
});

{'fraction_non_alphanumeric': 0.17852522639068563, 'fraction_numerical': 0.0, 'mean_word_length': 2.386861313868613, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '949926', 'n_tokens_mistral': 728, 'n_tokens_neox': 716, 'n_words': 145}