From 080c6d3146bee3691b6f3b9452be639354236e44 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 20 Dec 2018 14:32:11 -0800 Subject: fix(instant): catch unknown errors from executeBuyAsync, report them and show could not submit transaction --- .../instant/src/containers/selected_asset_buy_order_state_buttons.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/instant/src/containers') diff --git a/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts b/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts index 80943a96f..4da99cf04 100644 --- a/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts +++ b/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts @@ -95,6 +95,9 @@ const mapDispatchToProps = ( if (error === ZeroExInstantError.InsufficientETH) { const errorMessage = "You don't have enough ETH"; errorFlasher.flashNewErrorMessage(dispatch, errorMessage); + } else if (error === ZeroExInstantError.CouldNotSubmitTransaction) { + const errorMessage = 'Could not submit transaction'; + errorFlasher.flashNewErrorMessage(dispatch, errorMessage); } else { errorFlasher.flashNewErrorMessage(dispatch); } -- cgit v1.2.3 From 5721b25c3ace6e0dc336e2bfc7a0e45fd575a5a8 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 2 Jan 2019 16:08:15 +0100 Subject: feat: give all stateless components a displayName or make them private --- packages/instant/src/containers/latest_error.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/instant/src/containers') diff --git a/packages/instant/src/containers/latest_error.tsx b/packages/instant/src/containers/latest_error.tsx index 0d4349124..6da4558ef 100644 --- a/packages/instant/src/containers/latest_error.tsx +++ b/packages/instant/src/containers/latest_error.tsx @@ -14,7 +14,7 @@ import { zIndex } from '../style/z_index'; import { Asset, DisplayStatus, Omit, SlideAnimationState } from '../types'; import { errorFlasher } from '../util/error_flasher'; -export interface LatestErrorComponentProps { +interface LatestErrorComponentProps { asset?: Asset; latestErrorMessage?: string; animationState: SlideAnimationState; @@ -22,7 +22,7 @@ export interface LatestErrorComponentProps { onOverlayClick: () => void; } -export const LatestErrorComponent: React.StatelessComponent = props => { +const LatestErrorComponent: React.StatelessComponent = props => { if (!props.latestErrorMessage) { // Render a hidden SlidingError such that instant does not move when a real error is rendered. return ( -- cgit v1.2.3