diff options
rpc-engine not crashing when eth_watchToken
-rw-r--r-- | app/scripts/controllers/preferences.js | 9 | ||||
-rw-r--r-- | ui/app/components/pages/home.js | 4 |
2 files changed, 4 insertions, 9 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 8a4a63bb6..50f716852 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -57,7 +57,7 @@ class PreferencesController { addSuggestedToken (tokenOpts) { // TODO: Validate params const suggested = this.getSuggestedTokens() - suggested[tokenOpts.address] = suggested + suggested[tokenOpts.address] = tokenOpts this.store.updateState({ suggestedTokens: suggested }) } @@ -69,11 +69,10 @@ class PreferencesController { * @param {Function} - next * @param {Function} - end */ - requestAddToken(req, res, next, end) { + requestAddToken (req, res, next, end) { if (req.method === 'eth_watchToken') { // TODO: Validate params! const [ rawAddress, symbol, decimals ] = req.params - const tokenOpts = { address: rawAddress, decimals, @@ -82,8 +81,8 @@ class PreferencesController { this.addSuggestedToken(tokenOpts) this.showAddTokenUi() - - return end(rawAddress) + res.result = rawAddress + return end() } else { return next() } diff --git a/ui/app/components/pages/home.js b/ui/app/components/pages/home.js index cd4bf9033..97aaedd37 100644 --- a/ui/app/components/pages/home.js +++ b/ui/app/components/pages/home.js @@ -40,7 +40,6 @@ class Home extends Component { unapprovedTypedMessagesCount = 0, suggestedTokens = {}, unconfirmedTransactionsCount = 0, - } = this.props // suggested new tokens @@ -177,11 +176,8 @@ Home.propTypes = { isPopup: PropTypes.bool, isMouseUser: PropTypes.bool, t: PropTypes.func, -<<<<<<< HEAD suggestedTokens: PropTypes.object, -======= unconfirmedTransactionsCount: PropTypes.number, ->>>>>>> develop } function mapStateToProps (state) { |