diff options
eth_watchToken working
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 7a8d9667d..c15dd05a5 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -226,6 +226,7 @@ var actions = { addTokens, removeToken, updateTokens, + removeSuggestedTokens, UPDATE_TOKENS: 'UPDATE_TOKENS', setRpcTarget: setRpcTarget, setProviderType: setProviderType, @@ -1612,6 +1613,29 @@ function addTokens (tokens) { } } +function removeSuggestedTokens () { + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + return new Promise((resolve, reject) => { + background.removeSuggestedTokens((err) => { + dispatch(actions.hideLoadingIndication()) + if (err) { + dispatch(actions.displayWarning(err.message)) + reject(err) + } + dispatch(actions.clearPendingTokens()) + resolve() + }) + }) + } +} + +function clearPendingTokens () { + return { + type: actions.CLEAR_PENDING_TOKENS, + } +} + function updateTokens (newTokens) { return { type: actions.UPDATE_TOKENS, |