|
@ -6,6 +6,7 @@ import { fetchBalance } from './balance' |
|
|
import { setFormType } from './form' |
|
|
import { setFormType } from './form' |
|
|
import { resetPayForm } from './payform' |
|
|
import { resetPayForm } from './payform' |
|
|
import { setError } from './error' |
|
|
import { setError } from './error' |
|
|
|
|
|
import { fetchChannels } from './channels' |
|
|
|
|
|
|
|
|
// ------------------------------------
|
|
|
// ------------------------------------
|
|
|
// Constants
|
|
|
// Constants
|
|
@ -129,13 +130,15 @@ export const newTransaction = (event, { transaction }) => (dispatch, getState) = |
|
|
!state.transaction.transactions || |
|
|
!state.transaction.transactions || |
|
|
!state.transaction.transactions.find(tx => tx.tx_hash === transaction.tx_hash) |
|
|
!state.transaction.transactions.find(tx => tx.tx_hash === transaction.tx_hash) |
|
|
) { |
|
|
) { |
|
|
// Fetch new balance
|
|
|
|
|
|
dispatch(fetchBalance()) |
|
|
|
|
|
|
|
|
|
|
|
decorateTransaction(transaction) |
|
|
decorateTransaction(transaction) |
|
|
|
|
|
|
|
|
dispatch({ type: ADD_TRANSACTION, transaction }) |
|
|
dispatch({ type: ADD_TRANSACTION, transaction }) |
|
|
|
|
|
|
|
|
|
|
|
// fetch updated channels
|
|
|
|
|
|
dispatch(fetchChannels()) |
|
|
|
|
|
// fetch new balance
|
|
|
|
|
|
dispatch(fetchBalance()) |
|
|
|
|
|
|
|
|
// HTML 5 desktop notification for the new transaction
|
|
|
// HTML 5 desktop notification for the new transaction
|
|
|
if (transaction.received) { |
|
|
if (transaction.received) { |
|
|
showNotification( |
|
|
showNotification( |
|
|