feat: switch to a standalone script
This commit is contained in:
parent
c16e0ea776
commit
6287464cea
4 changed files with 164 additions and 23 deletions
|
|
@ -158,8 +158,7 @@ function run () {
|
|||
const validateAnswers = async (answers) => {
|
||||
if (_.size(answers) > 2) return { message: `Please insert a maximum of two coins to install.`, isValid: false }
|
||||
return getBlockchainSyncStatus(cryptos)
|
||||
.then(_blockchainStatuses => {
|
||||
const blockchainStatuses = _.filter(it => it !== 'disconnected', _blockchainStatuses)
|
||||
.then(blockchainStatuses => {
|
||||
const result = _.reduce((acc, value) => ({ ...acc, [value]: _.isNil(acc[value]) ? 1 : acc[value] + 1 }), {}, _.values(blockchainStatuses))
|
||||
if (_.size(answers) + result.syncing > 2) {
|
||||
return { message: `Installing these coins would pass the 2 parallel blockchain synchronization limit. Please try again with fewer coins or try again later.`, isValid: false }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue