2017-08-13 01:35:09 +00:00
|
|
|
import RocketChat from '../lib/rocketchat';
|
|
|
|
import * as types from '../constants/types';
|
|
|
|
import initialState from './initialState';
|
|
|
|
|
2017-08-13 23:02:46 +00:00
|
|
|
export function server(state = initialState.server, action) {
|
|
|
|
if (action.type === types.SET_CURRENT_SERVER) {
|
|
|
|
RocketChat.currentServer = action.payload;
|
|
|
|
return action.payload;
|
|
|
|
}
|
2017-08-13 01:35:09 +00:00
|
|
|
|
2017-08-13 23:02:46 +00:00
|
|
|
return state;
|
|
|
|
}
|
2017-08-13 01:35:09 +00:00
|
|
|
|
2017-08-13 23:02:46 +00:00
|
|
|
export function settings(state = initialState.settings, action) {
|
|
|
|
if (action.type === types.SET_ALL_SETTINGS) {
|
2017-08-17 06:28:41 +00:00
|
|
|
return { ...state,
|
2017-08-13 23:02:46 +00:00
|
|
|
...action.payload
|
|
|
|
};
|
2017-08-13 01:35:09 +00:00
|
|
|
}
|
2017-08-13 23:02:46 +00:00
|
|
|
|
|
|
|
return state;
|
2017-08-13 01:35:09 +00:00
|
|
|
}
|