<commit_before>import ActionTypes from '../constants/ActionTypes';
import AppDispatcher from '../dispatcher/AppDispatcher';
import Store from './Store';

class ValidationStore extends Store {
  constructor() {
    super();
    this._validations = null;
  }

  _setValidations(validations) {
    this._validations = validations;
    super.emitChange();
  }<commit_msg>only load validations to missions the user didn't fix himself<commit_after>import ActionTypes from '../constants/ActionTypes';
import AppDispatcher from '../dispatcher/AppDispatcher';
import loginStore from './LoginStore';
import Store from './Store';

class ValidationStore extends Store {
  constructor() {
    super();
    this._validations = null;
  }

  _getValidationsWithoutOwnFixes(validations) {
    const ownUserId = loginStore.getUserCredential().userId;
    const cleanValidations = [];
    validations.forEach((validation) => {
      if (validation.fixUserId === ownUserId) {
        cleanValidations.push(validation);
      }
    });

    return cleanValidations;
  }

  _setValidations(validations) {
    this._validations = this._getValidationsWithoutOwnFixes(validations);
    super.emitChange();
  }
{'fraction_non_alphanumeric': 0.11317567567567567, 'fraction_numerical': 0.0, 'mean_word_length': 4.1521739130434785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2106683', 'n_tokens_mistral': 325, 'n_tokens_neox': 318, 'n_words': 74}