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:
Saúl Ibarra Corretgé
2019-02-12 20:22:28 +01:00
committed by Saúl Ibarra Corretgé
parent 2442ef80b0
commit 8ea693616d
+1 -1
View File
@@ -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;