import { SERVER } from '../actions/actionsTypes';
const initialState = {
connecting: false,
connected: false,
failure: false,
server: '',
version: null,
loading: true,
adding: false,
previousServer: null
};
export default function server(state = initialState, action) {
switch (action.type) {
case SERVER.REQUEST:
return {
...state,
connecting: true,
failure: false
case SERVER.FAILURE:
failure: true
case SERVER.SELECT_REQUEST:
server: action.server,
version: action.version,
loading: true
case SERVER.SELECT_SUCCESS:
connected: true,
loading: false
case SERVER.SELECT_FAILURE:
case SERVER.INIT_ADD:
adding: true,
previousServer: action.previousServer
case SERVER.FINISH_ADD:
default:
return state;
}