Fix USD price for ETC

This commit is contained in:
Victor Baranov 2019-04-15 13:03:35 +03:00
parent 7a76d80eb2
commit adff219218
2 changed files with 5 additions and 3 deletions

View File

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

View File

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