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

pull/2457/head
zbettenbuk 7 years ago committed by Lyubo Marinov
parent d02ab2c641
commit 1474304cc5
  1. 5
      react/features/base/profile/reducer.js
  2. 5
      react/features/settings/components/AbstractSettingsView.js

@ -16,7 +16,10 @@ ReducerRegistry.register(
STORE_NAME, (state = {}, action) => {
switch (action.type) {
case PROFILE_UPDATED:
return action.profile;
return {
...state,
...action.profile
};
}
return state;

@ -150,10 +150,7 @@ export class AbstractSettingsView extends Component<Props> {
* @returns {void}
*/
_updateProfile(updateObject: Object) {
this.props.dispatch(updateProfile({
...this.props._profile,
...updateObject
}));
this.props.dispatch(updateProfile(updateObject));
}
}

Loading…
Cancel
Save