From 1474304cc5a1815fc5c7df68993a01121202b22b Mon Sep 17 00:00:00 2001 From: zbettenbuk Date: Mon, 12 Feb 2018 14:18:08 -0600 Subject: [PATCH] Add the ability to do partial updates on the flatten profile object --- react/features/base/profile/reducer.js | 5 ++++- react/features/settings/components/AbstractSettingsView.js | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/react/features/base/profile/reducer.js b/react/features/base/profile/reducer.js index c13013424..e65e07faf 100644 --- a/react/features/base/profile/reducer.js +++ b/react/features/base/profile/reducer.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; diff --git a/react/features/settings/components/AbstractSettingsView.js b/react/features/settings/components/AbstractSettingsView.js index 8bfdabd89..4a9d9dd44 100644 --- a/react/features/settings/components/AbstractSettingsView.js +++ b/react/features/settings/components/AbstractSettingsView.js @@ -150,10 +150,7 @@ export class AbstractSettingsView extends Component { * @returns {void} */ _updateProfile(updateObject: Object) { - this.props.dispatch(updateProfile({ - ...this.props._profile, - ...updateObject - })); + this.props.dispatch(updateProfile(updateObject)); } }