Rocket.Chat.ReactNative/app/reducers/reducers.js

23 lines
517 B
JavaScript
Raw Normal View History

2017-08-13 01:35:09 +00:00
import RocketChat from '../lib/rocketchat';
import * as types from '../constants/types';
import initialState from './initialState';
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
return state;
}
2017-08-13 01:35:09 +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,
...action.payload
};
2017-08-13 01:35:09 +00:00
}
return state;
2017-08-13 01:35:09 +00:00
}