diff options
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index d17d4610e..6ff28f32f 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -124,6 +124,7 @@ var actions = { showConfigPage, SHOW_ADD_TOKEN_PAGE: 'SHOW_ADD_TOKEN_PAGE', showAddTokenPage, + addToken, setRpcTarget: setRpcTarget, setDefaultRpcTarget: setDefaultRpcTarget, setProviderType: setProviderType, @@ -636,6 +637,19 @@ function showAddTokenPage (transitionForward = true) { } } +function addToken (address, symbol, decimals) { + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + background.addToken(address, symbol, decimals, (err) => { + dispatch(actions.hideLoadingIndication()) + if (err) { + return dispatch(actions.displayWarning(err.message)) + } + dispatch(actions.goHome()) + }) + } +} + function goBackToInitView () { return { type: actions.BACK_TO_INIT_MENU, |