aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/instant/src/components/buy_button.tsx9
-rw-r--r--packages/instant/src/types.ts6
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,