Add the ability to do partial updates on the flatten profile object
This commit is contained in:
parent
d02ab2c641
commit
1474304cc5
|
@ -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…
Reference in New Issue