diff options
Diffstat (limited to 'plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/dashboard/store/reducer/jetpack-settings.js')
-rw-r--r-- | plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/dashboard/store/reducer/jetpack-settings.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/dashboard/store/reducer/jetpack-settings.js b/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/dashboard/store/reducer/jetpack-settings.js new file mode 100644 index 00000000..1a1fc138 --- /dev/null +++ b/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/dashboard/store/reducer/jetpack-settings.js @@ -0,0 +1,22 @@ +/** + * Internal dependencies + */ +import { SET_JETPACK_SETTINGS } from '../actions/jetpack-settings'; + +const jetpackSettings = ( state = {}, action ) => { + switch ( action.type ) { + case SET_JETPACK_SETTINGS: + return { + ...state, + ...action.options, + is_toggling_module: + state.module_active !== action.options.module_active && !! action.options.is_updating, + is_toggling_instant_search: + state.instant_search_enabled !== action.options.instant_search_enabled && + !! action.options.is_updating, + }; + } + return state; +}; + +export default jetpackSettings; |