You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
820 B
33 lines
820 B
import { handleActions } from 'redux-actions';
|
|
import * as types from 'Store/Actions/actionTypes';
|
|
import getSectionState from 'Utilities/State/getSectionState';
|
|
import updateSectionState from 'Utilities/State/updateSectionState';
|
|
|
|
export const defaultState = {
|
|
refreshing: false,
|
|
token: null,
|
|
siteKey: null,
|
|
secretToken: null,
|
|
ray: null,
|
|
stoken: null,
|
|
responseUrl: null
|
|
};
|
|
|
|
const section = 'captcha';
|
|
|
|
const captchaReducers = handleActions({
|
|
|
|
[types.SET_CAPTCHA_VALUE]: function(state, { payload }) {
|
|
const newState = Object.assign(getSectionState(state, section), payload);
|
|
|
|
return updateSectionState(state, section, newState);
|
|
},
|
|
|
|
[types.RESET_CAPTCHA]: function(state) {
|
|
return updateSectionState(state, section, defaultState);
|
|
}
|
|
|
|
}, defaultState);
|
|
|
|
export default captchaReducers;
|