From a811bef32474a76588ebe12e314e9b353e051ac6 Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Tue, 11 Aug 2020 14:03:13 -0400 Subject: [PATCH] fix bug in SAVE_THREEBOX --- src/actions/profilesActions.ts | 3 +-- src/reducers/profilesReducer.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/actions/profilesActions.ts b/src/actions/profilesActions.ts index 24d02089b..b648dee05 100644 --- a/src/actions/profilesActions.ts +++ b/src/actions/profilesActions.ts @@ -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, }); } diff --git a/src/reducers/profilesReducer.ts b/src/reducers/profilesReducer.ts index b054a29a6..1ffc7bc01 100644 --- a/src/reducers/profilesReducer.ts +++ b/src/reducers/profilesReducer.ts @@ -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 } })); }