fix: pre release screen fixes
This commit is contained in:
parent
1bcc87757b
commit
5dd8501a17
98 changed files with 1569 additions and 1149 deletions
|
|
@ -5,6 +5,7 @@ const configManager = require('../new-config-manager')
|
|||
const wallet = require('../wallet')
|
||||
const ticker = require('../ticker')
|
||||
const coinUtils = require('../coin-utils')
|
||||
const logger = require('../logger')
|
||||
|
||||
function allScopes (cryptoScopes, machineScopes) {
|
||||
const scopes = []
|
||||
|
|
@ -68,6 +69,9 @@ function getSingleCoinFunding (settings, fiatCode, cryptoCode) {
|
|||
})
|
||||
}
|
||||
|
||||
// Promise.allSettled not running on current version of node
|
||||
const reflect = p => p.then(value => ({value, status: "fulfilled" }), error => ({error: error.toString(), status: "rejected" }))
|
||||
|
||||
function getFunding () {
|
||||
return settingsLoader.loadLatest().then(settings => {
|
||||
const cryptoCodes = configManager.getAllCryptoCurrencies(settings.config)
|
||||
|
|
@ -77,9 +81,10 @@ function getFunding () {
|
|||
const cryptoDisplays = _.filter(pareCoins, cryptoCurrencies)
|
||||
|
||||
const promises = cryptoDisplays.map(it => getSingleCoinFunding(settings, fiatCode, it.cryptoCode))
|
||||
return Promise.all(promises)
|
||||
return Promise.all(promises.map(reflect))
|
||||
.then((response) => {
|
||||
return _.toArray(_.merge(response, cryptoDisplays))
|
||||
const mapped = response.map(it => _.merge({ errorMsg: it.error }, it.value))
|
||||
return _.toArray(_.merge(mapped, cryptoDisplays))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue