Browse Source

fix(channels): fetch in activity mount not app

renovate/lint-staged-8.x
Jack Mallers 6 years ago
committed by Tom Kirkpatrick
parent
commit
b1b44489e5
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 10
      app/components/Activity/Activity.js
  2. 15
      app/components/App/App.js
  3. 2
      app/containers/Activity.js

10
app/components/Activity/Activity.js

@ -28,12 +28,19 @@ class Activity extends Component {
}
componentWillMount() {
const { fetchPayments, fetchInvoices, fetchTransactions, fetchBalance } = this.props
const {
fetchPayments,
fetchInvoices,
fetchTransactions,
fetchBalance,
fetchChannels
} = this.props
fetchBalance()
fetchPayments()
fetchInvoices()
fetchTransactions()
fetchChannels()
}
renderActivity(activity) {
@ -231,6 +238,7 @@ Activity.propTypes = {
fetchInvoices: PropTypes.func.isRequired,
fetchTransactions: PropTypes.func.isRequired,
fetchBalance: PropTypes.func.isRequired,
fetchChannels: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired,

15
app/components/App/App.js

@ -16,25 +16,14 @@ import styles from './App.scss'
class App extends Component {
componentWillMount() {
const {
fetchTicker,
fetchInfo,
fetchChannels,
fetchSuggestedNodes,
fetchBalance,
fetchDescribeNetwork
} = this.props
const { fetchTicker, fetchInfo, fetchSuggestedNodes, fetchDescribeNetwork } = this.props
// fetch price ticker
fetchTicker()
// fetch node info
fetchInfo()
// fetch nodes channels
fetchChannels()
// fetch suggested nodes list from zap.jackmallers.com/suggested-peers
fetchSuggestedNodes()
// fetch nodes balance
fetchBalance()
// fetch LN network from nides POV
fetchDescribeNetwork()
}
@ -104,8 +93,6 @@ App.propTypes = {
fetchInfo: PropTypes.func.isRequired,
fetchTicker: PropTypes.func.isRequired,
clearError: PropTypes.func.isRequired,
fetchChannels: PropTypes.func.isRequired,
fetchBalance: PropTypes.func.isRequired,
fetchDescribeNetwork: PropTypes.func.isRequired,
fetchSuggestedNodes: PropTypes.func.isRequired,

2
app/containers/Activity.js

@ -2,6 +2,7 @@ import { connect } from 'react-redux'
import { setLocale } from 'reducers/locale'
import { setCurrency, setFiatTicker, tickerSelectors } from 'reducers/ticker'
import { fetchBalance } from 'reducers/balance'
import { fetchChannels } from 'reducers/channels'
import { fetchInvoices, setInvoice, invoiceSelectors } from 'reducers/invoice'
import { setPayment, fetchPayments, paymentSelectors } from 'reducers/payment'
import { fetchTransactions } from 'reducers/transaction'
@ -43,6 +44,7 @@ const mapDispatchToProps = {
walletAddress,
openWalletModal,
fetchBalance,
fetchChannels,
updateSearchActive,
updateSearchText,
setFormType,

Loading…
Cancel
Save