From e100284c7671a7bd7b80c6770877e356ff03ca45 Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Thu, 23 May 2019 13:34:08 +0200 Subject: [PATCH] hide some errors that are too frequent --- src/actions/ethereum/SendFormValidationActions.js | 4 ++-- src/actions/ripple/SendFormValidationActions.js | 2 +- src/utils/formatUtils.js | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/actions/ethereum/SendFormValidationActions.js b/src/actions/ethereum/SendFormValidationActions.js index 23102150..875a23a0 100644 --- a/src/actions/ethereum/SendFormValidationActions.js +++ b/src/actions/ethereum/SendFormValidationActions.js @@ -408,7 +408,7 @@ export const calculateFee = (gasPrice: string, gasLimit: string): string => { 'ether' ); } catch (error) { - console.error(error); + // TODO: empty input throws this error. return '0'; } }; @@ -422,7 +422,7 @@ export const calculateTotal = (amount: string, gasPrice: string, gasLimit: strin } return bAmount.plus(calculateFee(gasPrice, gasLimit)).toFixed(); } catch (error) { - console.error(error); + // TODO: empty input throws this error. return '0'; } }; diff --git a/src/actions/ripple/SendFormValidationActions.js b/src/actions/ripple/SendFormValidationActions.js index d15a432e..33ddcc06 100644 --- a/src/actions/ripple/SendFormValidationActions.js +++ b/src/actions/ripple/SendFormValidationActions.js @@ -383,7 +383,7 @@ const calculateTotal = (amount: string, fee: string): string => { } return bAmount.plus(fee).toFixed(); } catch (error) { - console.error(error); + // TODO: empty input throws this error. return '0'; } }; diff --git a/src/utils/formatUtils.js b/src/utils/formatUtils.js index 1d8278ec..392ef109 100644 --- a/src/utils/formatUtils.js +++ b/src/utils/formatUtils.js @@ -11,7 +11,6 @@ export const toDecimalAmount = (amount: string | number, decimals: number): stri } return bAmount.div(10 ** decimals).toString(10); } catch (error) { - console.error(error); return '0'; } }; @@ -25,7 +24,6 @@ export const fromDecimalAmount = (amount: string | number, decimals: number): st } return bAmount.times(10 ** decimals).toString(10); } catch (error) { - console.error(error); return '0'; } };