feature/default_network_editable
Kevin Serrano 8 years ago
parent a612fcee64
commit 22528002e1
  1. 2
      app/scripts/lib/config-manager.js
  2. 6
      app/scripts/metamask-controller.js
  3. 4
      ui/app/actions.js
  4. 2
      ui/app/reducers/metamask.js

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

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

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

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

Loading…
Cancel
Save