<commit_before>import {
  TOGGLE_SSN_INFO,
  TOGGLE_TERMS_AND_CONDITIONS_INFO,
  REQUEST_CHECK_FOR_EXISTING_USER,
  CHECK_FOR_EXISTING_USER_SUCCESS,
  CHECK_FOR_EXISTING_USER_FAILURE
} from '../constants/ActionTypes'

const initialState = {
  showSSNInfo: false,
  isCheckingForExistingUser: false,
  checkForExistingUserSuccess: false
}

export default function registration (state = initialState, action) {
  switch (action.type) {
    case TOGGLE_SSN_INFO:
      return {
        ...state,
        showSSNInfo: !state.showSSNInfo
      }
    case TOGGLE_TERMS_AND_CONDITIONS_INFO:
      return {
        ...state,
        showTermsAndConditions: !state.showTermsAndConditions
      }
    case REQUEST_CHECK_FOR_EXISTING_USER:
      return {
        ...state,
        isCheckingForExistingUser: true, checkForExistingUserSuccess: false
      }
    case CHECK_FOR_EXISTING_USER_SUCCESS:
      return {
        ...state,
        checkForExistingUserSuccess: true, isCheckingForExistingUser: false
      }
    case CHECK_FOR_EXISTING_USER_FAILURE:
      return {
        ...state,
        checkForExistingUserSuccess: false, isCheckingForExistingUser: false
      }
    default:
      return state
  }
}
<commit_msg>patron-client: Reset registration when modal is hidden<commit_after>import {
  TOGGLE_SSN_INFO,
  TOGGLE_TERMS_AND_CONDITIONS_INFO,
  REQUEST_CHECK_FOR_EXISTING_USER,
  CHECK_FOR_EXISTING_USER_SUCCESS,
  CHECK_FOR_EXISTING_USER_FAILURE,
  HIDE_MODAL
} from '../constants/ActionTypes'

const initialState = {
  showSSNInfo: false,
  isCheckingForExistingUser: false,
  checkForExistingUserSuccess: false
}

export default function registration (state = initialState, action) {
  switch (action.type) {
    case TOGGLE_SSN_INFO:
      return {
        ...state,
        showSSNInfo: !state.showSSNInfo
      }
    case TOGGLE_TERMS_AND_CONDITIONS_INFO:
      return {
        ...state,
        showTermsAndConditions: !state.showTermsAndConditions
      }
    case REQUEST_CHECK_FOR_EXISTING_USER:
      return {
        ...state,
        isCheckingForExistingUser: true, checkForExistingUserSuccess: false
      }
    case CHECK_FOR_EXISTING_USER_SUCCESS:
      return {
        ...state,
        checkForExistingUserSuccess: true, isCheckingForExistingUser: false
      }
    case CHECK_FOR_EXISTING_USER_FAILURE:
      return {
        ...state,
        checkForExistingUserSuccess: false, isCheckingForExistingUser: false
      }
    case HIDE_MODAL:
      return initialState
    default:
      return state
  }
}

{'fraction_non_alphanumeric': 0.06872037914691943, 'fraction_numerical': 0.0, 'mean_word_length': 3.07890499194847, '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': '4901405', 'n_tokens_mistral': 827, 'n_tokens_neox': 826, 'n_words': 139}