aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/redux
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-31 04:27:28 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-31 04:27:28 +0800
commit05b74ba1c8b10c356d396ce9a4834d053cd791b1 (patch)
tree5cb88a3fb9eddb5783fd22501b14bae5b7d6ea6d /packages/instant/src/redux
parent12dad41143c50d858edbb665d4795142a6339dd7 (diff)
downloaddexon-sol-tools-05b74ba1c8b10c356d396ce9a4834d053cd791b1.tar.gz
dexon-sol-tools-05b74ba1c8b10c356d396ce9a4834d053cd791b1.tar.zst
dexon-sol-tools-05b74ba1c8b10c356d396ce9a4834d053cd791b1.zip
Dispatching progress
Diffstat (limited to 'packages/instant/src/redux')
-rw-r--r--packages/instant/src/redux/actions.ts3
-rw-r--r--packages/instant/src/redux/reducer.ts7
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/instant/src/redux/actions.ts b/packages/instant/src/redux/actions.ts
index bfae68e2b..59d059b59 100644
--- a/packages/instant/src/redux/actions.ts
+++ b/packages/instant/src/redux/actions.ts
@@ -28,6 +28,7 @@ export enum ActionTypes {
UPDATE_BUY_ORDER_STATE = 'UPDATE_BUY_ORDER_STATE',
UPDATE_LATEST_BUY_QUOTE = 'UPDATE_LATEST_BUY_QUOTE',
UPDATE_SELECTED_ASSET = 'UPDATE_SELECTED_ASSET',
+ UPDATE_ORDER_PROGRESS_PERCENTAGE = 'UPDATE_ORDER_PROGRESS_PERCENTAGE',
SET_QUOTE_REQUEST_STATE_PENDING = 'SET_QUOTE_REQUEST_STATE_PENDING',
SET_QUOTE_REQUEST_STATE_FAILURE = 'SET_QUOTE_REQUEST_STATE_FAILURE',
SET_ERROR_MESSAGE = 'SET_ERROR_MESSAGE',
@@ -43,6 +44,8 @@ export const actions = {
updateBuyOrderState: (orderState: OrderState) => createAction(ActionTypes.UPDATE_BUY_ORDER_STATE, orderState),
updateLatestBuyQuote: (buyQuote?: BuyQuote) => createAction(ActionTypes.UPDATE_LATEST_BUY_QUOTE, buyQuote),
updateSelectedAsset: (assetData?: string) => createAction(ActionTypes.UPDATE_SELECTED_ASSET, assetData),
+ updateOrderProgressPercentage: (percentDone: number) =>
+ createAction(ActionTypes.UPDATE_ORDER_PROGRESS_PERCENTAGE, percentDone),
setQuoteRequestStatePending: () => createAction(ActionTypes.SET_QUOTE_REQUEST_STATE_PENDING),
setQuoteRequestStateFailure: () => createAction(ActionTypes.SET_QUOTE_REQUEST_STATE_FAILURE),
setErrorMessage: (errorMessage: string) => createAction(ActionTypes.SET_ERROR_MESSAGE, errorMessage),
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts
index dd9403052..be336f7c2 100644
--- a/packages/instant/src/redux/reducer.ts
+++ b/packages/instant/src/redux/reducer.ts
@@ -12,6 +12,7 @@ import {
DisplayStatus,
Network,
OrderProcessState,
+ OrderProgress,
OrderState,
} from '../types';
import { assetUtils } from '../util/asset';
@@ -31,6 +32,7 @@ export interface State {
quoteRequestState: AsyncProcessState;
latestErrorMessage?: string;
latestErrorDisplayStatus: DisplayStatus;
+ orderProgress?: OrderProgress;
}
export const INITIAL_STATE: State = {
@@ -119,6 +121,11 @@ export const reducer = (state: State = INITIAL_STATE, action: Action): State =>
...state,
selectedAsset: newSelectedAsset,
};
+ case ActionTypes.UPDATE_ORDER_PROGRESS_PERCENTAGE:
+ return {
+ ...state,
+ orderProgress: { percentageDone: action.data },
+ };
case ActionTypes.RESET_AMOUNT:
return {
...state,