Browse Source

fix(sendcoins): close form modal on callback for successful sendcoins, not on submit of sendcoins

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
e61c8cb38c
  1. 2
      app/reducers/payment.js
  2. 1
      app/routes/app/components/components/Form/components/Pay/Pay.js

2
app/reducers/payment.js

@ -1,6 +1,7 @@
import { createSelector } from 'reselect'
import { ipcRenderer } from 'electron'
import { btc, usd } from '../utils'
import { setForm } from './form'
// ------------------------------------
// Constants
@ -78,6 +79,7 @@ export const sendSuccessful = (event, { amount, addr, txid }) => dispatch => {
console.log('amount: ', amount)
console.log('addr: ', addr)
console.log('txid: ', txid)
dispatch(setForm({ modalOpen: false }))
// TODO: Add successful on-chain payment to payments list once payments list supports on-chain and LN
// dispatch({ type: PAYMENT_SUCCESSFULL, payment: { amount, addr, txid, pending: true } })
}

1
app/routes/app/components/components/Form/components/Pay/Pay.js

@ -38,7 +38,6 @@ class Pay extends Component {
if (isOnchain) { sendCoins({ value: onchainAmount, addr: payment_request, currency, crypto, rate: currentTicker.price_usd }) }
if (isLn) { payInvoice(payment_request) }
close()
}
const calculateAmount = value => (currency === 'usd' ? btc.satoshisToUsd(value, currentTicker.price_usd) : btc.satoshisToBtc(value))

Loading…
Cancel
Save