From 42b3a7c9d756dd2c68256707c0c96a95370329bd Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Wed, 20 Dec 2017 18:36:12 +0100
Subject: Move call to error reporter to end of handler so that even if
 reporting the error takes a while, it doesn't block the UI

---
 packages/website/ts/components/eth_weth_conversion_button.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'packages/website/ts/components/eth_weth_conversion_button.tsx')

diff --git a/packages/website/ts/components/eth_weth_conversion_button.tsx b/packages/website/ts/components/eth_weth_conversion_button.tsx
index e802b8782..f45b72d9b 100644
--- a/packages/website/ts/components/eth_weth_conversion_button.tsx
+++ b/packages/website/ts/components/eth_weth_conversion_button.tsx
@@ -109,11 +109,11 @@ export class EthWethConversionButton extends
             } else if (!_.includes(errMsg, 'User denied transaction')) {
                 utils.consoleLog(`Unexpected error encountered: ${err}`);
                 utils.consoleLog(err.stack);
-                await errorReporter.reportAsync(err);
                 const errorMsg = direction === Side.Deposit ?
                                  'Failed to wrap your ETH. Please try again.' :
                                  'Failed to unwrap your WETH. Please try again.';
                 this.props.dispatcher.showFlashMessage(errorMsg);
+                await errorReporter.reportAsync(err);
             }
         }
         this.setState({
-- 
cgit 

