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() { componentWillMount() {
const { fetchPayments, fetchInvoices, fetchTransactions, fetchBalance } = this.props const {
fetchPayments,
fetchInvoices,
fetchTransactions,
fetchBalance,
fetchChannels
} = this.props
fetchBalance() fetchBalance()
fetchPayments() fetchPayments()
fetchInvoices() fetchInvoices()
fetchTransactions() fetchTransactions()
fetchChannels()
} }
renderActivity(activity) { renderActivity(activity) {
@ -231,6 +238,7 @@ Activity.propTypes = {
fetchInvoices: PropTypes.func.isRequired, fetchInvoices: PropTypes.func.isRequired,
fetchTransactions: PropTypes.func.isRequired, fetchTransactions: PropTypes.func.isRequired,
fetchBalance: PropTypes.func.isRequired, fetchBalance: PropTypes.func.isRequired,
fetchChannels: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired, ticker: PropTypes.object.isRequired,
currentTicker: 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 { class App extends Component {
componentWillMount() { componentWillMount() {
const { const { fetchTicker, fetchInfo, fetchSuggestedNodes, fetchDescribeNetwork } = this.props
fetchTicker,
fetchInfo,
fetchChannels,
fetchSuggestedNodes,
fetchBalance,
fetchDescribeNetwork
} = this.props
// fetch price ticker // fetch price ticker
fetchTicker() fetchTicker()
// fetch node info // fetch node info
fetchInfo() fetchInfo()
// fetch nodes channels
fetchChannels()
// fetch suggested nodes list from zap.jackmallers.com/suggested-peers // fetch suggested nodes list from zap.jackmallers.com/suggested-peers
fetchSuggestedNodes() fetchSuggestedNodes()
// fetch nodes balance
fetchBalance()
// fetch LN network from nides POV // fetch LN network from nides POV
fetchDescribeNetwork() fetchDescribeNetwork()
} }
@ -104,8 +93,6 @@ App.propTypes = {
fetchInfo: PropTypes.func.isRequired, fetchInfo: PropTypes.func.isRequired,
fetchTicker: PropTypes.func.isRequired, fetchTicker: PropTypes.func.isRequired,
clearError: PropTypes.func.isRequired, clearError: PropTypes.func.isRequired,
fetchChannels: PropTypes.func.isRequired,
fetchBalance: PropTypes.func.isRequired,
fetchDescribeNetwork: PropTypes.func.isRequired, fetchDescribeNetwork: PropTypes.func.isRequired,
fetchSuggestedNodes: 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 { setLocale } from 'reducers/locale'
import { setCurrency, setFiatTicker, tickerSelectors } from 'reducers/ticker' import { setCurrency, setFiatTicker, tickerSelectors } from 'reducers/ticker'
import { fetchBalance } from 'reducers/balance' import { fetchBalance } from 'reducers/balance'
import { fetchChannels } from 'reducers/channels'
import { fetchInvoices, setInvoice, invoiceSelectors } from 'reducers/invoice' import { fetchInvoices, setInvoice, invoiceSelectors } from 'reducers/invoice'
import { setPayment, fetchPayments, paymentSelectors } from 'reducers/payment' import { setPayment, fetchPayments, paymentSelectors } from 'reducers/payment'
import { fetchTransactions } from 'reducers/transaction' import { fetchTransactions } from 'reducers/transaction'
@ -43,6 +44,7 @@ const mapDispatchToProps = {
walletAddress, walletAddress,
openWalletModal, openWalletModal,
fetchBalance, fetchBalance,
fetchChannels,
updateSearchActive, updateSearchActive,
updateSearchText, updateSearchText,
setFormType, setFormType,

Loading…
Cancel
Save