From 9ef6f82a95c0faca0e6ba03ddd425271454dcfe3 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Thu, 1 Nov 2018 09:59:37 -0700 Subject: Take out old ended variable --- packages/instant/src/redux/reducer.ts | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'packages') diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts index 68b788be5..cf24f8488 100644 --- a/packages/instant/src/redux/reducer.ts +++ b/packages/instant/src/redux/reducer.ts @@ -111,17 +111,13 @@ export const reducer = (state: State = INITIAL_STATE, action: Action): State => const failureTxHash = action.data; if ('txHash' in state.buyOrderState) { if (state.buyOrderState.txHash === failureTxHash) { - const failureProgress = { - startTimeUnix: state.buyOrderState.progress.startTimeUnix, - expectedEndTimeUnix: state.buyOrderState.progress.expectedEndTimeUnix, - ended: true, - }; + const { txHash, progress } = state.buyOrderState; return { ...state, buyOrderState: { processState: OrderProcessState.FAILURE, - txHash: state.buyOrderState.txHash, - progress: failureProgress, + txHash, + progress, }, }; } @@ -131,17 +127,13 @@ export const reducer = (state: State = INITIAL_STATE, action: Action): State => const successTxHash = action.data; if ('txHash' in state.buyOrderState) { if (state.buyOrderState.txHash === successTxHash) { - const successProgress = { - startTimeUnix: state.buyOrderState.progress.startTimeUnix, - expectedEndTimeUnix: state.buyOrderState.progress.expectedEndTimeUnix, - ended: true, - }; + const { txHash, progress } = state.buyOrderState; return { ...state, buyOrderState: { processState: OrderProcessState.SUCCESS, - txHash: state.buyOrderState.txHash, - progress: successProgress, + txHash, + progress, }, }; } -- cgit v1.2.3