WIPP
This commit is contained in:
parent
1b89ed5c76
commit
2355054cdc
3 changed files with 20 additions and 21 deletions
|
|
@ -88,7 +88,7 @@ function plugins (settings) {
|
|||
}
|
||||
|
||||
function fetchCurrentConfigVersion () {
|
||||
const sql = `select id from config_users
|
||||
const sql = `select id from user_config
|
||||
where type=$1
|
||||
order by id desc
|
||||
limit 1`
|
||||
|
|
@ -425,6 +425,14 @@ function plugins (settings) {
|
|||
})
|
||||
}
|
||||
|
||||
function checkBalance (settings, rec) {
|
||||
const config = configManager.unscoped(settings.config)
|
||||
const lowBalanceThreshold = config.lowBalanceThreshold
|
||||
return lowBalanceThreshold && rec.fiatBalance < lowBalanceThreshold
|
||||
? {code: 'lowBalance', cryptoCode: rec.cryptoCode, fiatBalance: rec.fiatBalance, fiatCode: rec.fiatCode}
|
||||
: null
|
||||
}
|
||||
|
||||
function checkBalances () {
|
||||
return dbm.devices()
|
||||
.then(devices => {
|
||||
|
|
@ -438,6 +446,7 @@ function plugins (settings) {
|
|||
return R.values(R.reduceBy(min, Infinity, toMarket, R.flatten(arr)))
|
||||
})
|
||||
})
|
||||
.then(balances => R.reject(R.isNil, balances.map(balance => checkBalance)))
|
||||
}
|
||||
|
||||
function randomCode () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue