import * as types from "./actionTypes"; import initialState from "../../redux/reducers/initialState"; export default function serverReducer(state = initialState.server, action) { switch (action.type) { case types.LOAD_SERVER_DATA_SUCCESS: return { ...state, data: { ...action.payload, loading: false, loaded: true } }; case types.LOAD_SYSTEM_VERSION_SUCCESS: return { ...state, ...action.payload }; case types.LOAD_ACTIVE_SESSION_SUCCESS: return { ...state, activeSession: { ...action.payload, loading: false, loaded: true } }; default: return state; } }