Skip to content

Commit

Permalink
Finance: fix withdrawal panel not detecting tokens (#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai authored Jun 10, 2020
1 parent 6249ade commit 1753751
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions apps/finance/app/src/app-state-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ function appStateReducer(state) {
return {
...state,

tokens: balancesBn.map(({ address, decimals, name, symbol, verified }) => ({
address,
decimals: decimals.toNumber(),
name,
symbol,
verified,
})),
tokens: balancesBn.map(
({ address, amount, decimals, name, symbol, verified }) => ({
address,
// TODO: we should remove `amount` from this interface in the future, but right now it
// is the easiest way to tell components that this org holds this token
amount,
decimals: decimals.toNumber(),
name,
symbol,
verified,
})
),

// Filter out empty balances
balances: balancesBn.filter(balance => !balance.amount.isZero()),
Expand Down
2 changes: 1 addition & 1 deletion apps/finance/app/src/components/NewTransfer/Withdrawal.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Withdrawal extends React.Component {
}
}
nonZeroTokens() {
return this.props.tokens.filter(({ amount }) => amount > 0)
return this.props.tokens.filter(({ amount }) => !amount.isZero())
}
handleAmountUpdate = event => {
this.setState({
Expand Down

0 comments on commit 1753751

Please sign in to comment.