From 8a82e629bfa6545d09adf58e5b5d32cbdb1fba6f Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Wed, 17 Apr 2019 21:26:25 -0230 Subject: Ensure future tokens add decimals as numbers while supporting numbers and strings in send-asset-row --- .../confirm-add-suggested-token.container.js | 2 +- .../pages/send/send-content/send-asset-row/send-asset-row.component.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js index a90fe148f..cc73b2ea7 100644 --- a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js +++ b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.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()), } } diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js index 2982526cb..de2d9462f 100644 --- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js @@ -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, -- cgit v1.2.3