Skip to content

Commit

Permalink
color-scheme: fix React warning
Browse files Browse the repository at this point in the history
A reducer must always return a state or null to ignore it. When the color scheme
is undefined we should return the previous state.
  • Loading branch information
saghul committed Feb 12, 2019
1 parent 2442ef8 commit 8ea6936
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion react/features/base/color-scheme/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8ea6936

Please sign in to comment.