Skip to content
Permalink
Browse files

fix(wallet): update route every time user goes to summary

  • Loading branch information...
korhaliv committed Apr 3, 2019
1 parent de9e141 commit c1a4fb8b4b2f6e703b3debafaf04b46f73f71a32
Showing with 8 additions and 3 deletions.
  1. +8 −3 renderer/components/Pay/Pay.js
@@ -180,6 +180,10 @@ class Pay extends React.Component {
const isNowLightning = invoice && invoice !== prevState.invoice
if (currentStep === 'address' && isNowLightning) {
this.formApi.submitForm()
}

// update route
if (invoice && prevState.currentStep === 'address' && currentStep === 'summary') {
const { payeeNodeKey } = invoice
queryRoutes(payeeNodeKey, this.amountInSats())
}
@@ -347,9 +351,10 @@ class Pay extends React.Component {
*/
nextStep = () => {
const { currentStep } = this.state
const nextStep = Math.min(this.steps().indexOf(currentStep) + 1, this.steps().length - 1)
if (currentStep !== nextStep) {
this.setState({ currentStep: this.steps()[nextStep], previousStep: currentStep })
const nextStepIndex = Math.min(this.steps().indexOf(currentStep) + 1, this.steps().length - 1)
const nextStep = this.steps()[nextStepIndex]
if (currentStep !== nextStepIndex) {
this.setState({ currentStep: nextStep, previousStep: currentStep })
}
}

0 comments on commit c1a4fb8

Please sign in to comment.
You can’t perform that action at this time.