mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-15 01:22:01 +00:00
Merge pull request #569 from trezor/fix/remove-console-errors
Fix/hide some errors that are too frequent
This commit is contained in:
commit
01ddcf5349
@ -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';
|
||||
}
|
||||
};
|
||||
|
@ -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';
|
||||
}
|
||||
};
|
||||
|
@ -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';
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user