Permalink
Browse files

fix(wallet): fetch channels after new transaction

Make a call to fetch the updated channels whenever a new transaction is
detected.

Fix #579
Fix #580
  • Loading branch information...
mrfelton committed Aug 21, 2018
1 parent 73d15b9 commit 15b5caa2afebcbac0a6cf165ca731cbd1b3dfe1f
Showing with 6 additions and 3 deletions.
  1. +6 −3 app/reducers/transaction.js
@@ -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
@@ -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 updated channels
dispatch(fetchChannels())
// fetch new balance
dispatch(fetchBalance())
// HTML 5 desktop notification for the new transaction
if (transaction.received) {
showNotification(

0 comments on commit 15b5caa

Please sign in to comment.