Skip to content

Commit

Permalink
Small fix for accounts which don't support new balances feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaich committed Jan 16, 2020
1 parent 2dde8b7 commit 52a8a2f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/scripts/mintable.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@
)
}

const cleanedBalances = _.map(_.values(balances), account => _.at(account, process.env.BALANCE_COLUMNS))
const cleanedBalances = _.map(_.values(balances), account => {
if (account.error) {
return _.zipObject(process.env.BALANCE_COLUMNS, Array(process.env.BALANCE_COLUMNS.length).fill("Error"))
}
else {
return _.at(account, process.env.BALANCE_COLUMNS)
}
})

await require('../lib/google').updateRanges({
range: `Balances!A1:${alphabet[process.env.BALANCE_COLUMNS.length - 1]}${_.keys(balances).length + 1}`,
Expand Down

0 comments on commit 52a8a2f

Please sign in to comment.