diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-10-27 06:32:04 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-10-27 06:45:17 +0800 |
commit | 4f5ab1a72d33dc6a7516d7b1d51f1aa15752a6b8 (patch) | |
tree | bf3766ecf6ea51c6dfcd1d286c572b3410088087 /packages/instant/src/components/buy_button.tsx | |
parent | 51da5311b54733540f44f938a0c953bb4ae42052 (diff) | |
download | dexon-sol-tools-4f5ab1a72d33dc6a7516d7b1d51f1aa15752a6b8.tar.gz dexon-sol-tools-4f5ab1a72d33dc6a7516d7b1d51f1aa15752a6b8.tar.zst dexon-sol-tools-4f5ab1a72d33dc6a7516d7b1d51f1aa15752a6b8.zip |
Refactor error handling such that errorMessage lives on the top level state
Diffstat (limited to 'packages/instant/src/components/buy_button.tsx')
-rw-r--r-- | packages/instant/src/components/buy_button.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index a70269dde..9e06604e0 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -13,7 +13,7 @@ export interface BuyButtonProps { buyQuote?: BuyQuote; assetBuyer?: AssetBuyer; onAwaitingSignature: (buyQuote: BuyQuote) => void; - onSignatureDenied: (buyQuote: BuyQuote, preventedError: Error) => void; + onSignatureDenied: (buyQuote: BuyQuote) => void; onBuyProcessing: (buyQuote: BuyQuote, txHash: string) => void; onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void; onBuyFailure: (buyQuote: BuyQuote, txHash: string) => void; @@ -48,7 +48,7 @@ export class BuyButton extends React.Component<BuyButtonProps> { txHash = await assetBuyer.executeBuyQuoteAsync(buyQuote); } catch (e) { if (e instanceof Error && e.message === AssetBuyerError.SignatureRequestDenied) { - this.props.onSignatureDenied(buyQuote, e); + this.props.onSignatureDenied(buyQuote); return; } throw e; |