This commit is contained in:
Kevin Serrano 2016-07-22 10:15:39 -07:00
parent a612fcee64
commit 22528002e1
4 changed files with 8 additions and 6 deletions

View File

@ -296,7 +296,7 @@ ConfigManager.prototype.updateConversionRate = function () {
ConfigManager.prototype.setConversionPrice = function(price) {
var data = this.getData()
data.conversionRate = Number(parsedResponse.ticker.price)
data.conversionRate = Number(price)
this.setData(data)
}

View File

@ -251,7 +251,7 @@ module.exports = class MetamaskController {
}
cb(data)
} catch (e) {
cb(null,e)
cb(null, e)
}
}
@ -260,7 +260,9 @@ module.exports = class MetamaskController {
clearInterval(this.conversionInterval)
}
this.conversionInterval = setInterval(() => {
console.log("Updated currency!")
console.log('=================')
console.log('Updated currency!')
console.log('=================')
this.configManager.updateConversionRate()
}, 1000)
}

View File

@ -55,7 +55,7 @@ var actions = {
SHOW_CONF_MSG_PAGE: 'SHOW_CONF_MSG_PAGE',
REVEAL_ACCOUNT: 'REVEAL_ACCOUNT',
revealAccount: revealAccount,
SET_CURRENT_FIAT: 'SET_CURRENT_FIAT',
SET_CURRENT_FIAT: 'SET_CURRENT_FIAT',
setCurrentFiat: setCurrentFiat,
// account detail screen
SHOW_SEND_PAGE: 'SHOW_SEND_PAGE',
@ -220,7 +220,7 @@ function setCurrentFiat (fiat) {
currentFiat: data.currentFiat,
conversionRate: data.conversionRate,
conversionDate: data.conversionDate,
}
},
})
})
}

View File

@ -110,7 +110,7 @@ function reduceMetamask (state, action) {
return extend(metamaskState, { identities })
case actions.SET_CURRENT_FIAT:
return extend(metaMaskState, {
return extend(metamaskState, {
currentFiat: action.value.currentFiat,
conversionRate: action.value.conversionRate,
conversionDate: action.value.conversionDate,