Skip to content

Commit

Permalink
fix(wallet): fetch channels after new transaction
Browse files Browse the repository at this point in the history
Make a call to fetch the updated channels whenever a new transaction is
detected.

Fix LN-Zap#579
  • Loading branch information
mrfelton committed Aug 21, 2018
1 parent b86fcb9 commit 6206002
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/reducers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { fetchBalance } from './balance'
import { setFormType } from './form'
import { resetPayForm } from './payform'
import { setError } from './error'
import { fetchChannels } from './channels'

// ------------------------------------
// Constants
Expand Down Expand Up @@ -129,13 +130,15 @@ export const newTransaction = (event, { transaction }) => (dispatch, getState) =
!state.transaction.transactions ||
!state.transaction.transactions.find(tx => tx.tx_hash === transaction.tx_hash)
) {
// Fetch new balance
dispatch(fetchBalance())

decorateTransaction(transaction)

dispatch({ type: ADD_TRANSACTION, transaction })

// fetch nodes channels
dispatch(fetchChannels())
// fetch new balance
dispatch(fetchBalance())

// HTML 5 desktop notification for the new transaction
if (transaction.received) {
showNotification(
Expand Down

0 comments on commit 6206002

Please sign in to comment.