color-scheme: fix React warning
A reducer must always return a state or null to ignore it. When the color scheme is undefined we should return the previous state.
This commit is contained in:
parent
2442ef80b0
commit
8ea693616d
|
@ -14,7 +14,7 @@ import { SET_COLOR_SCHEME } from './actionTypes';
|
|||
ReducerRegistry.register('features/base/color-scheme', (state = {}, action) => {
|
||||
switch (action.type) {
|
||||
case SET_COLOR_SCHEME:
|
||||
return _.cloneDeep(action.colorScheme);
|
||||
return _.cloneDeep(action.colorScheme) || state;
|
||||
}
|
||||
|
||||
return state;
|
||||
|
|
Loading…
Reference in New Issue