aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-02 00:59:37 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-02 00:59:37 +0800
commit9ef6f82a95c0faca0e6ba03ddd425271454dcfe3 (patch)
treecafdc0effe085dfd36a56439e3fb04e7353f4a14 /packages
parenta148db5022379cdd8c0009d2f67f451dff376ad8 (diff)
downloaddexon-sol-tools-9ef6f82a95c0faca0e6ba03ddd425271454dcfe3.tar
dexon-sol-tools-9ef6f82a95c0faca0e6ba03ddd425271454dcfe3.tar.gz
dexon-sol-tools-9ef6f82a95c0faca0e6ba03ddd425271454dcfe3.tar.bz2
dexon-sol-tools-9ef6f82a95c0faca0e6ba03ddd425271454dcfe3.tar.lz
dexon-sol-tools-9ef6f82a95c0faca0e6ba03ddd425271454dcfe3.tar.xz
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.ts20
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,
},
};
}