Преглед изворни кода

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.
master
Saúl Ibarra Corretgé пре 6 година
родитељ
комит
8ea693616d
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1
    1
      react/features/base/color-scheme/reducer.js

+ 1
- 1
react/features/base/color-scheme/reducer.js Прегледај датотеку

14
 ReducerRegistry.register('features/base/color-scheme', (state = {}, action) => {
14
 ReducerRegistry.register('features/base/color-scheme', (state = {}, action) => {
15
     switch (action.type) {
15
     switch (action.type) {
16
     case SET_COLOR_SCHEME:
16
     case SET_COLOR_SCHEME:
17
-        return _.cloneDeep(action.colorScheme);
17
+        return _.cloneDeep(action.colorScheme) || state;
18
     }
18
     }
19
 
19
 
20
     return state;
20
     return state;

Loading…
Откажи
Сачувај