aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-22 04:56:04 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-22 04:56:04 +0800
commit8fde8a8921135112ccfdd13ce6b009755b5f71ed (patch)
treecd4ceb1dcd74a601506f92e5669e3022ca800c0c /ui/app/actions.js
parentab15b4c8259d6f6c5ae9d1e51548d73cfc1c67cb (diff)
downloadtangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.gz
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.bz2
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.lz
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.xz
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.zst
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.zip
Manually linted
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js28
1 files changed, 21 insertions, 7 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 5ceae6b6c..0cbc3b9e6 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -139,12 +139,6 @@ function closeMenu () {
}
}
-function getNetworkStatus () {
- return {
- type: actions.getNetworkStatus,
- }
-}
-
// async actions
function tryUnlockMetamask (password) {
@@ -164,6 +158,9 @@ function createNewVault (password, entropy) {
return (dispatch) => {
dispatch(actions.createNewVaultInProgress())
_accountManager.createNewVault(password, entropy, (err, result) => {
+ if (err) {
+ return dispatch(actions.showWarning(err.message))
+ }
dispatch(actions.showNewVaultSeed(result))
})
}
@@ -318,6 +315,10 @@ function agreeToDisclaimer () {
return (dispatch) => {
dispatch(this.showLoadingIndication())
_accountManager.agreeToDisclaimer((err) => {
+ if (err) {
+ return dispatch(actions.showWarning(err.message))
+ }
+
dispatch(this.hideLoadingIndication())
dispatch({
type: this.AGREE_TO_DISCLAIMER,
@@ -372,10 +373,14 @@ function updateMetamaskState (newState) {
function lockMetamask () {
return (dispatch) => {
_accountManager.setLocked((err) => {
+ dispatch(actions.hideLoadingIndication())
+ if (err) {
+ return dispatch(actions.showWarning(err.message))
+ }
+
dispatch({
type: actions.LOCK_METAMASK,
})
- dispatch(actions.hideLoadingIndication())
})
}
}
@@ -385,6 +390,10 @@ function showAccountDetail (address) {
dispatch(actions.showLoadingIndication())
_accountManager.setSelectedAddress(address, (err, address) => {
dispatch(actions.hideLoadingIndication())
+ if (err) {
+ return dispatch(actions.showWarning(err.message))
+ }
+
dispatch({
type: actions.SHOW_ACCOUNT_DETAIL,
value: address,
@@ -410,6 +419,11 @@ function confirmSeedWords () {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
_accountManager.clearSeedWordCache((err, account) => {
+ dispatch(actions.hideLoadingIndication())
+ if (err) {
+ return dispatch(actions.showWarning(err.message))
+ }
+
console.log('Seed word cache cleared. ' + account)
dispatch(actions.showAccountDetail(account))
})