From adff219218571f180c76a768f6e5648a6eeafeee Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 15 Apr 2019 13:03:35 +0300 Subject: [PATCH] Fix USD price for ETC --- app/scripts/controllers/currency.js | 2 +- ui/app/actions.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js index 7ce6b31d70af..6298b9593961 100644 --- a/app/scripts/controllers/currency.js +++ b/app/scripts/controllers/currency.js @@ -130,7 +130,7 @@ class CurrencyController { currentCurrency = this.getCurrentCurrency() currentCoin = this.getCurrentCoin() let conversionRate, conversionDate - if (currentCoin === 'poa') { + if (currentCoin === 'poa' || currentCoin === 'etc') { const apiLink = `https://min-api.cryptocompare.com/data/price?fsym=${currentCoin.toUpperCase()}&tsyms=${currentCurrency.toUpperCase()}` const response = await fetch(apiLink) const parsedResponse = await response.json() diff --git a/ui/app/actions.js b/ui/app/actions.js index 9845988fb57c..7ccba548e534 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -13,7 +13,8 @@ const log = require('loglevel') const { ENVIRONMENT_TYPE_NOTIFICATION } = require('../../app/scripts/lib/enums') const { POA, DAI, - POA_SOKOL } = require('../../app/scripts/controllers/network/enums') + POA_SOKOL, + CLASSIC } = require('../../app/scripts/controllers/network/enums') const { hasUnconfirmedTransactions } = require('./helpers/confirm-transaction/util') const WebcamUtils = require('../lib/webcam-utils') @@ -2012,7 +2013,8 @@ function setProviderType (type) { const newCoin = type === POA || type === POA_SOKOL ? 'poa' : type === DAI ? - 'dai' : 'eth' + 'dai' : type === CLASSIC ? + 'etc' : 'eth' background.setCurrentCoin(newCoin, (err, data) => { if (err) { log.error(err.stack)