diff options
author | Alexander Tseung <alextsg@gmail.com> | 2017-10-26 09:23:46 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-26 09:44:24 +0800 |
commit | 22d9e3a7e6dfd21b3ea52007030d71f53e29b851 (patch) | |
tree | 70cf675df91d5fe05185a99b72cb4edf44b5ba9a /ui/app/actions.js | |
parent | fa95303e1efef03db6c44878b89ccca680639598 (diff) | |
download | tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.gz tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.bz2 tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.lz tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.xz tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.zst tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.zip |
Allow editing account name in account details modal
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 445d19529..2e9b34c58 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -1034,7 +1034,7 @@ function setProviderType (type) { dispatch(actions.updateProviderType(type)) dispatch(actions.setSelectedToken()) }) - + } } @@ -1213,14 +1213,22 @@ function saveAccountLabel (account, label) { return (dispatch) => { dispatch(actions.showLoadingIndication()) log.debug(`background.saveAccountLabel`) - background.saveAccountLabel(account, label, (err) => { - dispatch(actions.hideLoadingIndication()) - if (err) { - return dispatch(actions.displayWarning(err.message)) - } - dispatch({ - type: actions.SAVE_ACCOUNT_LABEL, - value: { account, label }, + + return new Promise((resolve, reject) => { + background.saveAccountLabel(account, label, (err) => { + dispatch(actions.hideLoadingIndication()) + + if (err) { + dispatch(actions.displayWarning(err.message)) + reject(err) + } + + dispatch({ + type: actions.SAVE_ACCOUNT_LABEL, + value: { account, label }, + }) + + resolve(account) }) }) } |