Skip to content

Commit

Permalink
fix messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
schnogz committed Jun 5, 2018
1 parent 5d2105e commit 4d77702
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
Expand Up @@ -16,6 +16,8 @@
"components.alerts.create_wallet_info": "Creating wallet...",
"components.alerts.currency_update_error": "Failed to update currency",
"components.alerts.currency_update_success": "Currency has been successfully updated",
"components.alerts.address_delete_error": "Failed to delete address label.",
"components.alerts.address_delete_success": "Address deleted successfully.",
"components.alerts.document_upload_error": "Failed to upload document.",
"components.alerts.email_code_sent_success": "Confirmation code has been sent.",
"components.alerts.email_update_error": "Failed to update email address.",
Expand All @@ -25,6 +27,8 @@
"components.alerts.exchange_refresh_trades_error": "Failed to refresh all trades statuses.",
"components.alerts.exchange_refresh_trade_error": "Failed to refresh trade status.",
"components.alerts.exchange_transaction_error": "The transaction failed to send. Please try again later.",
"components.alerts.fetch_used_addresses_error": "Failed to retrieve used addresses.",
"components.alerts.fetch_unused_addresses_error": "Failed to retrieve unused addresses.",
"components.alerts.get_googleauth_secret_error": "Could not retrieve Google Authenticator secret.",
"components.alerts.google_auth_verify_error": "Failed to verify Google Authenticator code",
"components.alerts.google_auth_verify_success": "Google auth verified",
Expand Down Expand Up @@ -102,6 +106,8 @@
"components.alerts.yubikey_verify_error": "Failed to verify Yubikey",
"components.alerts.yubikey_verify_success": "Yubikey verified",
"components.alerts.captcha_code_incorrect": "The captcha you provided was incorrect, please try again",
"components.alerts.update_address_label_success": "Address label updated.",
"components.alerts.update_address_label_error": "Failed to update address label.",
"components.alerts.unknown_error": "An error has occurred.",
"coinify.banktransferdetails.header": "Bank Transfer Order Details",
"coinify.banktransferdetails.directions": "Funds must come from your bank account, which needs to be in the same name as your government issued ID. Coinify will reject any transfers from third party accounts not in your name.",
Expand Down
Expand Up @@ -35,6 +35,8 @@ const selectHeader = nature => {
}

const selectMessage = (message, data = undefined) => {
console.info(message)
console.info(data)
switch (message) {
case C.ADDRESS_ADD_ERROR: return <FormattedMessage id='components.alerts.addresserroradd' defaultMessage='Error adding address.' />
case C.ADDRESS_DELETE_ERROR: return <FormattedMessage id='components.alerts.address_delete_error' defaultMessage='Failed to delete address label.' />
Expand Down
@@ -1,12 +1,12 @@
import { call, put, select } from 'redux-saga/effects'
import { filter, findIndex, forEach, pluck, propEq, sort } from 'ramda'

import * as C from 'services/AlertService'
import * as A from './actions'
import * as actions from '../../actions'
import { selectors } from '../../index'
import settings from 'config'
import { Types } from 'blockchain-wallet-v4/src'
import * as C from 'services/AlertService'
import { promptForInput } from 'services/SagaService'

export default ({ api }) => {
Expand Down Expand Up @@ -122,7 +122,6 @@ export default ({ api }) => {

const editAddressLabel = function * (action) {
const { accountIndex, walletIndex, addressIndex } = action.payload

try {
yield put(A.editAddressLabelLoading(accountIndex))
let newLabel = yield call(promptForInput, { title: 'Rename Address Label' })
Expand All @@ -131,9 +130,11 @@ export default ({ api }) => {
yield put(A.editAddressLabelSuccess(walletIndex))
yield put(actions.alerts.displaySuccess(C.UPDATE_ADDRESS_LABEL_SUCCESS))
} catch (e) {
yield put(A.editAddressLabelError(walletIndex, e))
yield put(actions.logs.logErrorMessage(logLocation, 'editAddressLabel', e))
yield put(actions.alerts.displayError(C.UPDATE_ADDRESS_LABEL_ERROR))
if (e.message !== 'PROMPT_INPUT_CANCEL') {
yield put(A.editAddressLabelError(walletIndex, e))
yield put(actions.logs.logErrorMessage(logLocation, 'editAddressLabel', e))
yield put(actions.alerts.displayError(C.UPDATE_ADDRESS_LABEL_ERROR))
}
}
}

Expand Down
@@ -1,9 +1,9 @@
export const ADDRESS_ADD_ERROR = 'address_error_add'
export const ADDRESS_DELETE_SUCCESS = 'address_delete_success'
export const ADDRESS_DELETE_ERROR = 'address_delete_error'
export const ADDRESS_DOES_NOT_EXIST_ERROR = 'address_does_not_exist_error'
export const ADDRESS_FORMAT_NOT_SUPPORTED_ERROR = 'address_format_not_supported_error'
export const ADDRESS_LABEL_MAXIMUM_ERROR = 'address_label_maximum_error'
export const ADDRESS_LABEL_UPDATE_SUCCESS = 'address_label_update_success'
export const AUTHORIZATION_REQUIRED = 'authorization_required'
export const AUTHORIZATION_REQUIRED_INFO = 'authorization_required_info'
export const AUTOLOGOUT_UPDATE_ERROR = 'autologout_update_error'
export const AUTOLOGOUT_UPDATE_SUCCESS = 'autologout_update_success'
Expand All @@ -21,6 +21,8 @@ export const EMAIL_VERIFY_SUCCESS = 'email_verify_success'
export const EXCHANGE_REFRESH_TRADES_ERROR = 'exchange_refresh_trades_error'
export const EXCHANGE_REFRESH_TRADE_ERROR = 'exchange_refresh_trade_error'
export const EXCHANGE_TRANSACTION_ERROR = 'exchange_transaction_error'
export const FETCH_UNUSED_ADDRESSES_ERROR = 'fetch_unused_addresses_error'
export const FETCH_USED_ADDRESSES_ERROR = 'fetch_used_addresses_error'
export const GET_GOOGLEAUTH_SECRET_ERROR = 'get_googleauth_secret_error'
export const GOOGLE_AUTH_VERIFY_ERROR = 'google_auth_verify_error'
export const GOOGLE_AUTH_VERIFY_SUCCESS = 'google_auth_verify_success'
Expand Down Expand Up @@ -51,6 +53,7 @@ export const MOBILE_UPDATE_ERROR = 'mobile_update_error'
export const MOBILE_UPDATE_SUCCESS = 'mobile_update_success'
export const MOBILE_VERIFY_ERROR = 'mobile_verify_error'
export const MOBILE_VERIFY_SUCCESS = 'mobile_verify_success'
export const NEW_ADDRESS_GENERATE_ERROR = 'new_address_generate_error'
export const NEW_WALLET_CREATE_ERROR = 'new_wallet_create_error'
export const NEW_WALLET_CREATE_SUCCESS = 'new_wallet_create_success'
export const PBKDF2_UPDATE_SUCCESS = 'pbkdf2_update_success'
Expand All @@ -64,7 +67,6 @@ export const RESTORE_ERROR = 'restore_error'
export const RESTORE_SUCCESS = 'restore_success'
export const RESTORE_WALLET_INFO = 'restore_wallet_info'
export const SECOND_PASSWORD_INVALID_ERROR = 'second_passsword_invalid_error'
export const SECOND_PASSWORD_TOGGLE_SUCCESS = 'second_password_toggle_success'
export const SEND_BCH_ERROR = 'send_bch_error'
export const SEND_BCH_SUCCESS = 'send_bch_success'
export const SEND_BTC_ERROR = 'send_btc_error'
Expand Down Expand Up @@ -97,4 +99,6 @@ export const WALLET_SESSION_ERROR = 'wallet_session_error'
export const WALLET_UPGRADE_ERROR = 'wallet_upgrade_error'
export const YUBIKEY_VERIFY_ERROR = 'yubikey_verify_error'
export const YUBIKEY_VERIFY_SUCCESS = 'yubikey_verify_success'
export const UPDATE_ADDRESS_LABEL_SUCCESS = 'update_address_label_success'
export const UPDATE_ADDRESS_LABEL_ERROR = 'update_address_label_error'
export const CAPTCHA_CODE_INCORRECT = 'captcha_code_incorrect'

0 comments on commit 4d77702

Please sign in to comment.