Skip to content

Commit

Permalink
fix bug in SAVE_THREEBOX
Browse files Browse the repository at this point in the history
  • Loading branch information
dkent600 committed Aug 11, 2020
1 parent 4169df7 commit a811bef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/actions/profilesActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,11 @@ async function get3Box(accountAddress: Address, dispatch: any, state: any, withS
if (updateState) {
/**
* This is synchronous.
* Has the annoying side-effect of deleting the threeBox and threeBoxSpace properties in the payload.
*/
dispatch({
type: ActionTypes.SAVE_THREEBOX,
sequence: AsyncActionSequence.Success,
payload: { ...result },
payload: result,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/reducers/profilesReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const profilesReducer = (
switch (action.type) {
case ActionTypes.SAVE_THREEBOX: {
const threeBoxPayload = action.payload as I3BoxState;
let newState: I3BoxState;
const newState: I3BoxState = {};
if (threeBoxPayload && threeBoxPayload.threeBox) {
Object.assign(newState, update(state, { threeBox: { $set: threeBoxPayload.threeBox } }));
}
Expand Down

0 comments on commit a811bef

Please sign in to comment.