Browse Source

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
renovate/lint-staged-8.x
Tom Kirkpatrick 6 years ago
parent
commit
15b5caa2af
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 9
      app/reducers/transaction.js

9
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(

Loading…
Cancel
Save