aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/actions.js19
-rw-r--r--ui/app/reducers/metamask.js7
2 files changed, 26 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 82a319907..a5846f0d2 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -55,6 +55,8 @@ var actions = {
SHOW_CONF_MSG_PAGE: 'SHOW_CONF_MSG_PAGE',
REVEAL_ACCOUNT: 'REVEAL_ACCOUNT',
revealAccount: revealAccount,
+ SET_CURRENT_FIAT: 'SET_CURRENT_FIAT',
+ setCurrentFiat: setCurrentFiat,
// account detail screen
SHOW_SEND_PAGE: 'SHOW_SEND_PAGE',
showSendPage: showSendPage,
@@ -214,6 +216,23 @@ function revealAccount () {
}
}
+function setCurrentFiat (fiat) {
+ return (dispatch) => {
+ dispatch(this.showLoadingIndication())
+ _accountManager.setCurrentFiat(fiat, (data, err) => {
+ dispatch(this.hideLoadingIndication())
+ dispatch({
+ type: this.SET_CURRENT_FIAT,
+ value: {
+ currentFiat: data.currentFiat,
+ conversionRate: data.conversionRate,
+ conversionDate: data.conversionDate,
+ },
+ })
+ })
+ }
+}
+
function signMsg (msgData) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 8d4520fb1..eba59ab45 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -114,6 +114,13 @@ function reduceMetamask (state, action) {
var identities = extend(metamaskState.identities, id)
return extend(metamaskState, { identities })
+ case actions.SET_CURRENT_FIAT:
+ return extend(metamaskState, {
+ currentFiat: action.value.currentFiat,
+ conversionRate: action.value.conversionRate,
+ conversionDate: action.value.conversionDate,
+ })
+
default:
return metamaskState