瀏覽代碼

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 年之前
父節點
當前提交
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…
取消
儲存