<commit_before>/*
 * This file is part of the Kreta package.
 *
 * (c) <NAME> <<EMAIL>>
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

import ActionTypes from './../constants/ActionTypes';

const initialState = {
  errors: [],
  fetching: true,
  organizations: [],
  projects: []
};

export default function reducer(state = initialState, action = {}) {
  switch (action.type) {
    case ActionTypes.DASHBOARD_DATA_FETCHING:
      return {...state, fetching: true};

    case ActionTypes.DASHBOARD_DATA_RECEIVED:
      return {...state, organizations: action.organizations, projects: action.projects, fetching: false};

    case ActionTypes.DASHBOARD_DATA_FETCH_ERROR:
      return {...state, error: true};

    default:
      return state;
  }
}<commit_msg>Changed errors to boolean inside dashboard reducer<commit_after>/*
 * This file is part of the Kreta package.
 *
 * (c) <NAME> <<EMAIL>>
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

import ActionTypes from './../constants/ActionTypes';

const initialState = {
  errors: false,
  fetching: true,
  organizations: [],
  projects: []
};

export default function reducer(state = initialState, action = {}) {
  switch (action.type) {
    case ActionTypes.DASHBOARD_DATA_FETCHING:
      return {...state, fetching: true};

    case ActionTypes.DASHBOARD_DATA_RECEIVED:
      return {...state, organizations: action.organizations, projects: action.projects, fetching: false};

    case ActionTypes.DASHBOARD_DATA_FETCH_ERROR:
      return {...state, error: true};

    default:
      return state;
  }
}
{'fraction_non_alphanumeric': 0.12359550561797752, 'fraction_numerical': 0.0, 'mean_word_length': 3.625974025974026, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '5698820', 'n_tokens_mistral': 542, 'n_tokens_neox': 535, 'n_words': 163}