1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-29 02:18:06 +00:00

rewrite static notification condition (xrp || txrp)

This commit is contained in:
Szymon Lesisz 2019-01-09 18:03:41 +01:00 committed by Szymon Lesisz
parent 2c24b75d47
commit 3ebce65093

View File

@ -15,10 +15,11 @@ export default (props: Props) => {
if (!location || !selectedAccount || !account) return null;
// Ripple minimum reserve notification
if (account.networkType === 'ripple') {
const { reserve, balance } = account;
const bigBalance = new Bignumber(balance);
const bigReserve = new Bignumber(reserve);
if (location.pathname.includes('xrp') && (bigBalance.lessThan(bigReserve) || bigBalance.lessThanOrEqualTo(new Bignumber(0)))) {
if (bigBalance.lessThan(bigReserve)) {
notifications.push(
<Notification
key="xrp-warning"
@ -28,6 +29,7 @@ export default (props: Props) => {
/>,
);
}
}
return (
<React.Fragment>