Просмотр исходного кода

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.
j8
Saúl Ibarra Corretgé 6 лет назад
Родитель
Сommit
8ea693616d
1 измененных файлов: 1 добавлений и 1 удалений
  1. 1
    1
      react/features/base/color-scheme/reducer.js

+ 1
- 1
react/features/base/color-scheme/reducer.js Просмотреть файл

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

Загрузка…
Отмена
Сохранить