<commit_before>import { SUBMIT_EMAIL_REQUEST, SUBMIT_EMAIL_RESPONSE, SUBMIT_EMAIL_ERROR } from '../actions'

const initialState = {
  errors: null,
  messageId: null,
  isSubmittingEmail: false,
  showSuccess: false,
}
const emails = (state = initialState, action) => {
  switch (action.type) {
    case SUBMIT_EMAIL_REQUEST:
      return {
        ...state,
        isSubmittingEmail: true,
        errors: null,
        showSuccess: false
      }
    case SUBMIT_EMAIL_RESPONSE:
      return {
        ...state,
        isSubmittingEmail: false,
        errors: null,
        messageId: action.payload.messageId,
        showSuccess: true,
      }
    case SUBMIT_EMAIL_ERROR:
      return {
        ...state,
        isSubmittingEmail: false,
        errors: action.payload.errors,
        showSuccess: true
      }
    default:
      return state<commit_msg>Client: bugfix - do not show success on validation errors - duh<commit_after>import { SUBMIT_EMAIL_REQUEST, SUBMIT_EMAIL_RESPONSE, SUBMIT_EMAIL_ERROR } from '../actions'

const initialState = {
  errors: null,
  messageId: null,
  isSubmittingEmail: false,
  showSuccess: false,
}
const emails = (state = initialState, action) => {
  switch (action.type) {
    case SUBMIT_EMAIL_REQUEST:
      return {
        ...state,
        isSubmittingEmail: true,
        errors: null,
        showSuccess: false
      }
    case SUBMIT_EMAIL_RESPONSE:
      return {
        ...state,
        isSubmittingEmail: false,
        errors: null,
        messageId: action.payload.messageId,
        showSuccess: true,
      }
    case SUBMIT_EMAIL_ERROR:
      return {
        ...state,
        isSubmittingEmail: false,
        errors: action.payload.errors,
        showSuccess: false,
      }
    default:
      return state
{'fraction_non_alphanumeric': 0.09121621621621621, 'fraction_numerical': 0.0, 'mean_word_length': 2.2907407407407407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7030566', 'n_tokens_mistral': 548, 'n_tokens_neox': 551, 'n_words': 124}