Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finance: fix withdrawal panel not detecting tokens #1159

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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