2019-07-29 16:33:28 +00:00
|
|
|
import { SHARE } from '../actions/actionsTypes';
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
user: {},
|
2020-11-04 16:53:44 +00:00
|
|
|
server: {},
|
2020-10-30 15:54:02 +00:00
|
|
|
settings: {}
|
2019-07-29 16:33:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default function share(state = initialState, action) {
|
|
|
|
switch (action.type) {
|
|
|
|
case SHARE.SELECT_SERVER:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
server: action.server
|
|
|
|
};
|
|
|
|
case SHARE.SET_USER:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
user: action.user
|
|
|
|
};
|
2020-10-30 15:54:02 +00:00
|
|
|
case SHARE.SET_SETTINGS:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
settings: action.settings
|
|
|
|
};
|
2019-07-29 16:33:28 +00:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|