Merge pull request #6481 from MetaMask/address-prop-types-errors

Address prop types errors
feature/default_network_editable
Thomas Huang 6 years ago committed by GitHub
commit 4fa9576cc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js
  2. 2
      ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js
  3. 3
      ui/app/selectors/selectors.js

@ -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()),
}
}

@ -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,

@ -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) {

Loading…
Cancel
Save