diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-02 00:59:37 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-02 00:59:37 +0800 |
commit | 9ef6f82a95c0faca0e6ba03ddd425271454dcfe3 (patch) | |
tree | cafdc0effe085dfd36a56439e3fb04e7353f4a14 /packages | |
parent | a148db5022379cdd8c0009d2f67f451dff376ad8 (diff) | |
download | dexon-sol-tools-9ef6f82a95c0faca0e6ba03ddd425271454dcfe3.tar.gz dexon-sol-tools-9ef6f82a95c0faca0e6ba03ddd425271454dcfe3.tar.zst dexon-sol-tools-9ef6f82a95c0faca0e6ba03ddd425271454dcfe3.zip |
Take out old ended variable
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/src/redux/reducer.ts | 20 |
1 files changed, 6 insertions, 14 deletions
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, }, }; } |