aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorKevin G. Serrano <kevgagser@gmail.com>2016-11-08 08:02:02 +0800
committerKevin G. Serrano <kevgagser@gmail.com>2016-11-08 08:02:02 +0800
commit7b3f1ecc41e1c57252f1d862930aebc3e9c446ea (patch)
treeec1237fd092d218d2bb8f807cbb9e5c0a07af708 /ui/app/actions.js
parent30ff9b5e10f12588a213496921e84514c2018641 (diff)
downloadtangerine-wallet-browser-7b3f1ecc41e1c57252f1d862930aebc3e9c446ea.tar
tangerine-wallet-browser-7b3f1ecc41e1c57252f1d862930aebc3e9c446ea.tar.gz
tangerine-wallet-browser-7b3f1ecc41e1c57252f1d862930aebc3e9c446ea.tar.bz2
tangerine-wallet-browser-7b3f1ecc41e1c57252f1d862930aebc3e9c446ea.tar.lz
tangerine-wallet-browser-7b3f1ecc41e1c57252f1d862930aebc3e9c446ea.tar.xz
tangerine-wallet-browser-7b3f1ecc41e1c57252f1d862930aebc3e9c446ea.tar.zst
tangerine-wallet-browser-7b3f1ecc41e1c57252f1d862930aebc3e9c446ea.zip
Unify warning functions.
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js23
1 files changed, 9 insertions, 14 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 1f0d8fc78..3d9588083 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -43,7 +43,6 @@ var actions = {
unlockInProgress: unlockInProgress,
// error handling
displayWarning: displayWarning,
- showWarning: showWarning, // alias
DISPLAY_WARNING: 'DISPLAY_WARNING',
HIDE_WARNING: 'HIDE_WARNING',
hideWarning: hideWarning,
@@ -180,7 +179,7 @@ function createNewVault (password, entropy) {
dispatch(actions.createNewVaultInProgress())
_accountManager.createNewVault(password, entropy, (err, result) => {
if (err) {
- return dispatch(actions.showWarning(err.message))
+ return dispatch(actions.displayWarning(err.message))
}
dispatch(actions.showNewVaultSeed(result))
})
@@ -355,7 +354,7 @@ function agreeToDisclaimer () {
dispatch(this.showLoadingIndication())
_accountManager.agreeToDisclaimer((err) => {
if (err) {
- return dispatch(actions.showWarning(err.message))
+ return dispatch(actions.displayWarning(err.message))
}
dispatch(this.hideLoadingIndication())
@@ -420,7 +419,7 @@ function lockMetamask () {
_accountManager.setLocked((err) => {
dispatch(actions.hideLoadingIndication())
if (err) {
- return dispatch(actions.showWarning(err.message))
+ return dispatch(actions.displayWarning(err.message))
}
dispatch({
@@ -436,7 +435,7 @@ function showAccountDetail (address) {
_accountManager.setSelectedAddress(address, (err, address) => {
dispatch(actions.hideLoadingIndication())
if (err) {
- return dispatch(actions.showWarning(err.message))
+ return dispatch(actions.displayWarning(err.message))
}
dispatch({
@@ -466,7 +465,7 @@ function confirmSeedWords () {
_accountManager.clearSeedWordCache((err, account) => {
dispatch(actions.hideLoadingIndication())
if (err) {
- return dispatch(actions.showWarning(err.message))
+ return dispatch(actions.displayWarning(err.message))
}
console.log('Seed word cache cleared. ' + account)
@@ -571,10 +570,6 @@ function hideSubLoadingIndication () {
}
}
-function showWarning (text) {
- return this.displayWarning(text)
-}
-
function displayWarning (text) {
return {
type: actions.DISPLAY_WARNING,
@@ -626,7 +621,7 @@ function saveAccountLabel (account, label) {
_accountManager.saveAccountLabel(account, label, (err) => {
dispatch(actions.hideLoadingIndication())
if (err) {
- return dispatch(actions.showWarning(err.message))
+ return dispatch(actions.displayWarning(err.message))
}
dispatch({
type: actions.SAVE_ACCOUNT_LABEL,
@@ -721,7 +716,7 @@ function shapeShiftSubview (network) {
shapeShiftRequest('marketinfo', {pair}, (mktResponse) => {
shapeShiftRequest('getcoins', {}, (response) => {
dispatch(actions.hideSubLoadingIndication())
- if (mktResponse.error) return dispatch(actions.showWarning(mktResponse.error))
+ if (mktResponse.error) return dispatch(actions.displayWarning(mktResponse.error))
dispatch({
type: actions.SHAPESHIFT_SUBVIEW,
value: {
@@ -738,7 +733,7 @@ function coinShiftRquest (data, marketData) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
shapeShiftRequest('shift', { method: 'POST', data}, (response) => {
- if (response.error) return dispatch(actions.showWarning(response.error))
+ if (response.error) return dispatch(actions.displayWarning(response.error))
var message = `
Deposit your ${response.depositType} to the address bellow:`
_accountManager.createShapeShiftTx(response.deposit, response.depositType)
@@ -760,7 +755,7 @@ function reshowQrCode (data, coin) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => {
- if (mktResponse.error) return dispatch(actions.showWarning(mktResponse.error))
+ if (mktResponse.error) return dispatch(actions.displayWarning(mktResponse.error))
var message = [
`Deposit your ${coin} to the address bellow:`,