mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add data field to pass up parameters up to reducer.
This commit is contained in:
parent
491b9cddc5
commit
4a9d5b1c25
@ -99,6 +99,8 @@ IdentityStore.prototype.getState = function () {
|
|||||||
unconfMsgs: messageManager.unconfirmedMsgs(),
|
unconfMsgs: messageManager.unconfirmedMsgs(),
|
||||||
messages: messageManager.getMsgList(),
|
messages: messageManager.getMsgList(),
|
||||||
selectedAddress: configManager.getSelectedAccount(),
|
selectedAddress: configManager.getSelectedAccount(),
|
||||||
|
currentFiat: configManager.getCurrentFiat(),
|
||||||
|
currentConversion: configManager.getConversionRate(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,8 +241,13 @@ module.exports = class MetamaskController {
|
|||||||
try {
|
try {
|
||||||
this.configManager.setCurrentFiat(fiat)
|
this.configManager.setCurrentFiat(fiat)
|
||||||
this.configManager.setConversionRate()
|
this.configManager.setConversionRate()
|
||||||
|
const data = {
|
||||||
|
conversionRate: this.configManager.getConversionRate,
|
||||||
|
currentFiat: this.configManager.getCurrentFiat,
|
||||||
|
}
|
||||||
|
cb(data)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
cb(e)
|
cb(null,e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,10 +212,14 @@ function revealAccount () {
|
|||||||
function setCurrentFiat (fiat) {
|
function setCurrentFiat (fiat) {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(this.showLoadingIndication())
|
dispatch(this.showLoadingIndication())
|
||||||
_accountManager.setCurrentFiat(fiat, (err) => {
|
_accountManager.setCurrentFiat(fiat, (data, err) => {
|
||||||
dispatch(this.hideLoadingIndication())
|
dispatch(this.hideLoadingIndication())
|
||||||
dispatch({
|
dispatch({
|
||||||
type: this.SET_CURRENT_FIAT,
|
type: this.SET_CURRENT_FIAT,
|
||||||
|
value: {
|
||||||
|
currentFiat: data.currentFiat,
|
||||||
|
conversionRate: data.conversionRate,
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,12 @@ function reduceMetamask (state, action) {
|
|||||||
var identities = extend(metamaskState.identities, id)
|
var identities = extend(metamaskState.identities, id)
|
||||||
return extend(metamaskState, { identities })
|
return extend(metamaskState, { identities })
|
||||||
|
|
||||||
|
case actions.SET_CURRENT_FIAT:
|
||||||
|
return extend(metaMaskState, {
|
||||||
|
currentFiat: action.value.currentFiat,
|
||||||
|
conversionRate: action.value.conversionRate,
|
||||||
|
})
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return metamaskState
|
return metamaskState
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user