From b1b44489e52449d0a8985674d3ebd18320ef995b Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Wed, 19 Sep 2018 21:00:59 -0500 Subject: [PATCH] fix(channels): fetch in activity mount not app --- app/components/Activity/Activity.js | 10 +++++++++- app/components/App/App.js | 15 +-------------- app/containers/Activity.js | 2 ++ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/components/Activity/Activity.js b/app/components/Activity/Activity.js index fce2d2cb..431dafbe 100644 --- a/app/components/Activity/Activity.js +++ b/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, diff --git a/app/components/App/App.js b/app/components/App/App.js index cee2b240..6aa8a4e8 100644 --- a/app/components/App/App.js +++ b/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, diff --git a/app/containers/Activity.js b/app/containers/Activity.js index da6fd7e8..0b02ac11 100644 --- a/app/containers/Activity.js +++ b/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,