diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-26 05:54:19 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-26 05:54:19 +0800 |
commit | e3510f3bcf4eea76d93888faedd822117bab7bdb (patch) | |
tree | 6737a36f05d21b2dab292199cb81e7bd39fce4c1 /packages/instant/src | |
parent | cd06c0e913bf8f4a1d7b29eecb01c87f92a76e89 (diff) | |
parent | 89e59cca28a86763519237ab9c6971600e200b5e (diff) | |
download | dexon-sol-tools-e3510f3bcf4eea76d93888faedd822117bab7bdb.tar dexon-sol-tools-e3510f3bcf4eea76d93888faedd822117bab7bdb.tar.gz dexon-sol-tools-e3510f3bcf4eea76d93888faedd822117bab7bdb.tar.bz2 dexon-sol-tools-e3510f3bcf4eea76d93888faedd822117bab7bdb.tar.lz dexon-sol-tools-e3510f3bcf4eea76d93888faedd822117bab7bdb.tar.xz dexon-sol-tools-e3510f3bcf4eea76d93888faedd822117bab7bdb.tar.zst dexon-sol-tools-e3510f3bcf4eea76d93888faedd822117bab7bdb.zip |
Merge branch 'feature/instant/view-processings-txn' into feature/instant/txn-failure
Diffstat (limited to 'packages/instant/src')
-rw-r--r-- | packages/instant/src/components/buy_button.tsx | 9 | ||||
-rw-r--r-- | packages/instant/src/types.ts | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index a7a22e3bc..a70269dde 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -49,14 +49,9 @@ export class BuyButton extends React.Component<BuyButtonProps> { } catch (e) { if (e instanceof Error && e.message === AssetBuyerError.SignatureRequestDenied) { this.props.onSignatureDenied(buyQuote, e); - } else { - throw e; + return; } - } - - // Have to let TS know that txHash is definitely defined now - if (!txHash) { - throw new Error('No txHash available'); + throw e; } this.props.onBuyProcessing(buyQuote, txHash); diff --git a/packages/instant/src/types.ts b/packages/instant/src/types.ts index 63b49cb26..c63371fb4 100644 --- a/packages/instant/src/types.ts +++ b/packages/instant/src/types.ts @@ -16,14 +16,14 @@ export enum OrderProcessState { FAILURE = 'Failure', } -interface OrderStateWithoutTx { +interface OrderStatePreTx { processState: OrderProcessState.NONE | OrderProcessState.AWAITING_SIGNATURE; } -interface OrderStateWithTx { +interface OrderStatePostTx { processState: OrderProcessState.PROCESSING | OrderProcessState.SUCCESS | OrderProcessState.FAILURE; txHash: string; } -export type OrderState = OrderStateWithoutTx | OrderStateWithTx; +export type OrderState = OrderStatePreTx | OrderStatePostTx; export enum DisplayStatus { Present, |