Skip to content
Permalink
Browse files

fix(ui): clear payment request after pay button has been pressed

  • Loading branch information...
korhaliv committed Apr 15, 2019
1 parent f141e29 commit aee69335470b5629a5341231754b274ae7650e19
Showing with 12 additions and 2 deletions.
  1. +12 −2 renderer/components/Pay/Pay.js
@@ -182,7 +182,7 @@ class Pay extends React.Component {
this.formApi.submitForm()
}

// If we now have a valid lightning invoice, call queryRoutes and submit the form.
// If we now have a valid lightning invoice submit the form.
const isNowLightning = invoice && invoice !== prevState.invoice
if (currentStep === 'address' && isNowLightning) {
this.formApi.submitForm()
@@ -272,7 +272,15 @@ class Pay extends React.Component {
*/
onSubmit = values => {
const { currentStep, isOnchain } = this.state
const { cryptoCurrency, payInvoice, routes, sendCoins, changeFilter, closeModal } = this.props
const {
cryptoCurrency,
payInvoice,
routes,
sendCoins,
changeFilter,
closeModal,
setPayReq,
} = this.props
if (currentStep === 'summary') {
if (isOnchain) {
// Determine the fee rate to use.
@@ -296,6 +304,8 @@ class Pay extends React.Component {
feeLimit: getMaxFee(routes),
retries: CONFIG.invoices.retryCount,
})
// clear payment request
setPayReq(null)
// Close the form modal once the payment has been sent
changeFilter('ALL_ACTIVITY')
closeModal()

0 comments on commit aee6933

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