aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/redux
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-20 04:51:57 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-20 04:51:57 +0800
commit6c79a858dff2766917ee3a4b5d4f623b66dadd17 (patch)
tree80ed81159418eaa9f57deff046d4376a5cc349ae /packages/instant/src/redux
parent17b282b1d743c83a4a4378eb71df098949569bdd (diff)
downloaddexon-sol-tools-6c79a858dff2766917ee3a4b5d4f623b66dadd17.tar.gz
dexon-sol-tools-6c79a858dff2766917ee3a4b5d4f623b66dadd17.tar.zst
dexon-sol-tools-6c79a858dff2766917ee3a4b5d4f623b66dadd17.zip
WIP: clear buy quote working
Diffstat (limited to 'packages/instant/src/redux')
-rw-r--r--packages/instant/src/redux/actions.ts2
-rw-r--r--packages/instant/src/redux/reducer.ts8
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/instant/src/redux/actions.ts b/packages/instant/src/redux/actions.ts
index bc75ce66c..d6388d77e 100644
--- a/packages/instant/src/redux/actions.ts
+++ b/packages/instant/src/redux/actions.ts
@@ -31,6 +31,7 @@ export enum ActionTypes {
SET_ERROR = 'SET_ERROR',
HIDE_ERROR = 'HIDE_ERROR',
CLEAR_ERROR = 'CLEAR_ERROR',
+ CLEAR_BUY_QUOTE_AND_SELECTED_ASSET_AMOUNT = 'CLEAR_BUY_QUOTE_AND_SELECTED_ASSET_AMOUNT',
}
export const actions = {
@@ -45,4 +46,5 @@ export const actions = {
setError: (error?: any) => createAction(ActionTypes.SET_ERROR, error),
hideError: () => createAction(ActionTypes.HIDE_ERROR),
clearError: () => createAction(ActionTypes.CLEAR_ERROR),
+ clearBuyQuoteAndSelectedAssetAmount: () => createAction(ActionTypes.CLEAR_BUY_QUOTE_AND_SELECTED_ASSET_AMOUNT),
};
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts
index 657bd0e40..10e56f152 100644
--- a/packages/instant/src/redux/reducer.ts
+++ b/packages/instant/src/redux/reducer.ts
@@ -99,6 +99,14 @@ export const reducer = (state: State = INITIAL_STATE, action: Action): State =>
...state,
selectedAsset: newSelectedAsset,
};
+ case ActionTypes.CLEAR_BUY_QUOTE_AND_SELECTED_ASSET_AMOUNT:
+ return {
+ ...state,
+ latestBuyQuote: undefined,
+ quoteState: AsyncProcessState.NONE,
+ buyOrderState: AsyncProcessState.NONE,
+ selectedAssetAmount: undefined,
+ };
default:
return state;
}