<commit_before>import Ember from 'ember';

export default Ember.Controller.extend({
  model: null,
  session: null,
  frameIndex: 0,
  framePage: 0,
  store: Ember.inject.service(),
  isDirty: function() {
    // TODO: check the session model to see if it contains unsaved data
    var session = this.get('session');
    return session.get('hasDirtyAttributes');
  },
  actions: {
    saveSession(session) {
      this.set('session', session);
      this.get('session').save();
    }
  }
});<commit_msg>Get frameIndex & framePage from session<commit_after>import Ember from 'ember';

export default Ember.Controller.extend({
  model: null,
  session: null,
  frameIndex: Ember.computed(function() {
    var session = this.get('session');
    if (session && session.get('frameIndex')) {
      return session.get('frameIndex');
    }
    return 0;
  }),
  framePage: Ember.computed(function() {
    var session = this.get('session');
    if (session && session.get('framePage')) {
      return session.get('framePage');
    }
    return 0;
  }),
  store: Ember.inject.service(),
  isDirty: function() {
    // TODO: check the session model to see if it contains unsaved data
    var session = this.get('session');
    return session.get('hasDirtyAttributes');
  },
  actions: {
    saveSession(session) {
      this.set('session', session);
      this.get('session').save();
    }
  }
});
{'fraction_non_alphanumeric': 0.15079365079365079, 'fraction_numerical': 0.002886002886002886, 'mean_word_length': 3.3892405063291138, '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': '3422776', 'n_tokens_mistral': 430, 'n_tokens_neox': 425, 'n_words': 106}