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

This commit is contained in:
zbettenbuk 2018-02-12 14:18:08 -06:00 committed by Lyubo Marinov
parent d02ab2c641
commit 1474304cc5
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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));
}
}