fix: correctly test the alert thresholds (considering falsy values)
This commit is contained in:
parent
b1574c277a
commit
106fa166b0
1 changed files with 2 additions and 2 deletions
|
|
@ -706,10 +706,10 @@ function plugins (settings, deviceId) {
|
||||||
fiatCode,
|
fiatCode,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lowAlertThreshold && BN(fiatBalance.balance).lt(lowAlertThreshold))
|
if (_.isFinite(lowAlertThreshold) && BN(fiatBalance.balance).lt(lowAlertThreshold))
|
||||||
return _.set('code')('LOW_CRYPTO_BALANCE')(req)
|
return _.set('code')('LOW_CRYPTO_BALANCE')(req)
|
||||||
|
|
||||||
if (highAlertThreshold && BN(fiatBalance.balance).gt(highAlertThreshold))
|
if (_.isFinite(highAlertThreshold) && BN(fiatBalance.balance).gt(highAlertThreshold))
|
||||||
return _.set('code')('HIGH_CRYPTO_BALANCE')(req)
|
return _.set('code')('HIGH_CRYPTO_BALANCE')(req)
|
||||||
|
|
||||||
return null
|
return null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue