Browse Source
Merge pull request #796 from LN-Zap/fix/fetchChannels
fix(channels): fetch in activity mount not app
renovate/lint-staged-8.x
Tom Kirkpatrick
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
12 additions and
15 deletions
-
app/components/Activity/Activity.js
-
app/components/App/App.js
-
app/containers/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, |
|
|
|
|
|
@ -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,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, |
|
|
|