瀏覽代碼

Add the ability to do partial updates on the flatten profile object

master
zbettenbuk 7 年之前
父節點
當前提交
1474304cc5
共有 2 個檔案被更改,包括 5 行新增5 行删除
  1. 4
    1
      react/features/base/profile/reducer.js
  2. 1
    4
      react/features/settings/components/AbstractSettingsView.js

+ 4
- 1
react/features/base/profile/reducer.js 查看文件

@@ -16,7 +16,10 @@ ReducerRegistry.register(
16 16
     STORE_NAME, (state = {}, action) => {
17 17
         switch (action.type) {
18 18
         case PROFILE_UPDATED:
19
-            return action.profile;
19
+            return {
20
+                ...state,
21
+                ...action.profile
22
+            };
20 23
         }
21 24
 
22 25
         return state;

+ 1
- 4
react/features/settings/components/AbstractSettingsView.js 查看文件

@@ -150,10 +150,7 @@ export class AbstractSettingsView extends Component<Props> {
150 150
      * @returns {void}
151 151
      */
152 152
     _updateProfile(updateObject: Object) {
153
-        this.props.dispatch(updateProfile({
154
-            ...this.props._profile,
155
-            ...updateObject
156
-        }));
153
+        this.props.dispatch(updateProfile(updateObject));
157 154
     }
158 155
 }
159 156
 

Loading…
取消
儲存