Skip to content

Commit

Permalink
Merge pull request #6481 from MetaMask/address-prop-types-errors
Browse files Browse the repository at this point in the history
Address prop types errors
  • Loading branch information
tmashuang authored Apr 18, 2019
2 parents 3519e90 + 8a82e62 commit 4fa9576
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const mapStateToProps = ({ metamask }) => {

const mapDispatchToProps = dispatch => {
return {
addToken: ({address, symbol, decimals, image}) => dispatch(addToken(address, symbol, decimals, image)),
addToken: ({address, symbol, decimals, image}) => dispatch(addToken(address, symbol, Number(decimals), image)),
removeSuggestedTokens: () => dispatch(removeSuggestedTokens()),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class SendAssetRow extends Component {
tokens: PropTypes.arrayOf(
PropTypes.shape({
address: PropTypes.string,
decimals: PropTypes.number,
decimals: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
symbol: PropTypes.string,
})
).isRequired,
Expand Down
3 changes: 2 additions & 1 deletion ui/app/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ function getAccountType (state) {
}

function getSelectedAsset (state) {
return getSelectedToken(state) || 'ETH'
const selectedToken = getSelectedToken(state)
return selectedToken && selectedToken.symbol || 'ETH'
}

function getCurrentNetworkId (state) {
Expand Down

0 comments on commit 4fa9576

Please sign in to comment.