Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
perf: don't fetch onchain fees when paying LN invoice
Browse files Browse the repository at this point in the history
resolve #3175
  • Loading branch information
korhaliv committed Nov 14, 2019
1 parent d5f543a commit d346f9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions renderer/components/Pay/Pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ class Pay extends React.Component {

// Set a flag so that we can trigger form submission in componentDidUpdate once the form is loaded.
componentDidMount() {
const { fetchTickers, queryFees } = this.props
const { fetchTickers } = this.props
fetchTickers()
queryFees()
}

componentDidUpdate(prevProps, prevState) {
const { redirectPayReq, queryRoutes, setRedirectPayReq } = this.props
const { redirectPayReq, queryRoutes, setRedirectPayReq, queryFees } = this.props
const { currentStep, invoice, isOnchain } = this.state
const { address, amount } = redirectPayReq || {}
const { payReq: prevPayReq } = prevProps || {}
Expand Down Expand Up @@ -107,6 +106,7 @@ class Pay extends React.Component {
// If we now have a valid onchain address, trigger the form submit to move to the amount step.
const isNowOnchain = isOnchain && isOnchain !== prevState.isOnchain
if (currentStep === PAY_FORM_STEPS.address && isNowOnchain) {
queryFees()
this.formApi.submitForm()
return
}
Expand Down

0 comments on commit d346f9f

Please sign in to comment.