fix: small fixes

This commit is contained in:
Sérgio Salgado 2022-04-18 15:23:59 +01:00
parent ffdab69ce0
commit 157137afc0
2 changed files with 2 additions and 2 deletions

View file

@ -94,7 +94,7 @@ function sendCoins (account, tx, settings, operatorId) {
function newAddress (account, info, tx, settings, operatorId) {
return checkCryptoCode(info.cryptoCode)
.then(() => fetch('z_listaccounts'))
.then(accountsRes => _.size(accountsRes) === 0 ? fetch('z_getnewaccount') : Promise.resolve(_.first(accountsRes)))
.then(accountsRes => _.isEmpty(accountsRes) ? fetch('z_getnewaccount') : Promise.resolve(_.first(accountsRes)))
.then(account => fetch('z_getaddressforaccount', [account.account]))
.then(res => res.address)
}