HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/globfdxw/www/wp-content/plugins/give/src/DonorDashboards/resources/js/app/store/reducer.js
import {initialState} from './initialState';

export const reducer = (state = initialState, action) => {
    switch (action.type) {
        case 'SET_ACTIVE_TAB':
            return {
                ...state,
                activeTab: action.payload.tab,
            };
        case 'ADD_TAB':
            const registeredTabs = Object.assign({}, state.tabs);
            registeredTabs[action.payload.tab.slug] = action.payload.tab;

            return {
                ...state,
                tabs: registeredTabs,
            };
        case 'SET_PROFILE':
            return {
                ...state,
                profile: action.payload.profile,
            };
        case 'SET_APPLICATION_ERROR':
            return {
                ...state,
                applicationError: action.payload.error,
            };
        case 'SET_STATES':
            return {
                ...state,
                states: action.payload.states,
            };
        case 'SET_FETCHING_STATES':
            return {
                ...state,
                fetchingStates: action.payload.fetchingStates,
            };
        default:
            return state;
    }
};