Skip to content

Commit

Permalink
fix(Alert): call correct alert
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Jun 14, 2018
1 parent 6295ed0 commit 6359b15
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"components.alerts.new_address_generate_error": "Failed to generate new address.",
"components.alerts.new_wallet_create_success": "Successfully created new wallet",
"components.alerts.pbkdf2_update_success": "PBKDF2 iterations changed successfully",
"components.alerts.receive_bch_success": "You have received a bitcoin cash payment.",
"components.alerts.receive_btc_success": "You have received a bitcoin payment.",
"components.alerts.receive_eth_success": "You have received an ether payment.",
"components.alerts.register_error": "Wallet could not be created",
"components.alerts.register_successful": "Wallet successfully created",
"components.alerts.rename_bch_wallet_error": "Failed to update Bitcoin Cash account label",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import * as sagas from './sagas'
export default function * () {
yield takeEvery(AT.alerts.ALERTS_SHOW, sagas.handleTimer)
yield takeEvery(AT.core.webSocket.bitcoin.PAYMENT_RECEIVED, sagas.paymentReceived)
yield takeEvery(AT.core.webSocket.bch.PAYMENT_RECEIVED, sagas.paymentReceived)
yield takeEvery(AT.core.webSocket.ethereum.PAYMENT_RECEIVED, sagas.paymentReceived)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export const STOP_SOCKET = '@CORE.BCH.STOP_SOCKET'
export const OPEN_SOCKET = '@CORE.BCH.OPEN_SOCKET'
export const MESSAGE_SOCKET = '@CORE.BCH.MESSAGE_SOCKET'
export const CLOSE_SOCKET = '@CORE.BCH.CLOSE_SOCKET'

export const PAYMENT_RECEIVED = '@CORE.WEBSOCKET.BCH_PAYMENT_RECEIVED'
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ export const stopSocket = () => ({ type: T.STOP_SOCKET })
export const openSocket = () => ({ type: T.OPEN_SOCKET })
export const messageSocket = (payload) => ({ type: T.MESSAGE_SOCKET, payload })
export const closeSocket = () => ({ type: T.CLOSE_SOCKET })

export const paymentReceived = (message) => ({type: T.BCH_PAYMENT_RECEIVED, message})
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { call, put, select, take } from 'redux-saga/effects'
import { compose } from 'ramda'
import * as A from '../../actions'
import * as C from 'services/AlertService'
import * as walletSelectors from '../../wallet/selectors'
import { Socket } from '../../../network/index'
import * as bchActions from '../../data/bch/actions'
Expand All @@ -26,7 +27,7 @@ export default ({ api, bchSocket }) => {
const tx = transactions.payload.transactions[i]
if (tx.hash === message.x.hash) {
if (tx.result > 0) {
yield put(A.webSocket.bitcoin.paymentReceived('You\'ve just received a bitcoin payment.'))
yield put(A.webSocket.bch.paymentReceived(C.RECEIVE_BTC_SUCCESS))
}
break
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export const OPEN_SOCKET = '@CORE.BITCOIN.OPEN_SOCKET'
export const MESSAGE_SOCKET = '@CORE.BITCOIN.MESSAGE_SOCKET'
export const CLOSE_SOCKET = '@CORE.BITCOIN.CLOSE_SOCKET'

export const PAYMENT_RECEIVED = '@CORE.WEBSOCKET.PAYMENT_RECEIVED'
export const PAYMENT_RECEIVED = '@CORE.WEBSOCKET.BTC_PAYMENT_RECEIVED'
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export const openSocket = () => ({ type: T.OPEN_SOCKET })
export const messageSocket = (payload) => ({ type: T.MESSAGE_SOCKET, payload })
export const closeSocket = () => ({ type: T.CLOSE_SOCKET })

export const paymentReceived = (message) => ({type: T.PAYMENT_RECEIVED, message})
export const paymentReceived = (message) => ({type: T.BTC_PAYMENT_RECEIVED, message})
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { call, put, select, take } from 'redux-saga/effects'
import { compose } from 'ramda'
import * as A from '../../actions'
import * as C from 'services/AlertService'
import { Wrapper } from '../../../types/index'
import * as walletSelectors from '../../wallet/selectors'
import { Socket } from '../../../network/index'
Expand Down Expand Up @@ -40,7 +41,7 @@ export default ({ api, btcSocket }) => {
const tx = transactions.payload.transactions[i]
if (tx.hash === message.x.hash) {
if (tx.result > 0) {
yield put(A.webSocket.bitcoin.paymentReceived("You've just received a bitcoin payment."))
yield put(A.webSocket.bitcoin.paymentReceived(C.RECEIVE_BTC_SUCCESS))
}
break
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export const STOP_SOCKET = '@CORE.ETHEREUM.STOP_SOCKET'
export const OPEN_SOCKET = '@CORE.ETHEREUM.OPEN_SOCKET'
export const MESSAGE_SOCKET = '@CORE.ETHEREUM.MESSAGE_SOCKET'
export const CLOSE_SOCKET = '@CORE.ETHEREUM.CLOSE_SOCKET'

export const PAYMENT_RECEIVED = '@CORE.WEBSOCKET.ETH_PAYMENT_RECEIVED'
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ export const stopSocket = () => ({ type: T.STOP_SOCKET })
export const openSocket = () => ({ type: T.OPEN_SOCKET })
export const messageSocket = (payload) => ({ type: T.MESSAGE_SOCKET, payload })
export const closeSocket = () => ({ type: T.CLOSE_SOCKET })

export const paymentReceived = (message) => ({type: T.ETH_PAYMENT_RECEIVED, message})
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { call, put, select, take } from 'redux-saga/effects'
import * as A from '../../actions'
import * as C from 'services/AlertService'
import * as ethAT from '../../kvStore/ethereum/actionTypes'
import * as ethSelectors from '../../kvStore/ethereum/selectors'
import * as ethActions from '../../data/ethereum/actions'
Expand Down Expand Up @@ -28,7 +29,7 @@ export default ({ api, ethSocket }) => {
break
}
if (message.tx.to === message.account) {
yield put(A.webSocket.bitcoin.paymentReceived('You\'ve just received an Ethereum payment.'))
yield put(A.webSocket.ethereum.paymentReceived(C.RECEIVE_ETH_SUCCESS))
}
const context = yield select(ethSelectors.getContext)
yield put(ethActions.fetchData(context.data))
Expand Down

0 comments on commit 6359b15

Please sign in to comment.