Skip to content
Permalink
Browse files

fix(ui): prevent crash when sending funds onchain

  • Loading branch information...
korhaliv committed Jun 6, 2019
1 parent b9ac9f2 commit d7d364de515a246d7ddcfc69b6f1162c52c47fe8
Showing with 10 additions and 6 deletions.
  1. +2 −1 renderer/components/Pay/Pay.js
  2. +8 −5 renderer/components/Pay/PaySummaryOnChain.js
@@ -559,7 +559,7 @@ class Pay extends React.Component {

renderSummary = () => {
const { currentStep, isOnchain } = this.state
const { routes } = this.props
const { routes, lndTargetConfirmations } = this.props

const formState = this.formApi.getState()
const { speed, payReq, isCoinSweep } = formState.values
@@ -579,6 +579,7 @@ class Pay extends React.Component {
amount={amount}
fee={this.getFee()}
isCoinSweep={isCoinSweep}
lndTargetConfirmations={lndTargetConfirmations}
mt={-3}
speed={speed}
/>
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import { Box, Flex } from 'rebass'
import { FormattedMessage } from 'react-intl'
import BigArrowRight from 'components/Icon/BigArrowRight'
import { Bar, DataRow, Spinner, Text } from 'components/UI'
import { Bar, DataRow, Spinner, Text, TransactionSpeedDesc } from 'components/UI'
import { CryptoSelector, CryptoValue, FiatValue } from 'containers/UI'
import { Truncate } from 'components/Util'
import messages from './messages'
@@ -22,6 +22,7 @@ class PaySummaryOnChain extends React.Component {
isCoinSweep: PropTypes.bool,
/** Boolean indicating wether routing information is currently being fetched. */
isQueryingFees: PropTypes.bool,
lndTargetConfirmations: PropTypes.object.isRequired,
/** Current fee information as provided by bitcoinfees.earn.com */
onchainFees: PropTypes.shape({
fast: PropTypes.number,
@@ -52,11 +53,11 @@ class PaySummaryOnChain extends React.Component {
onchainFees,
isQueryingFees,
isCoinSweep,
lndTargetConfirmations,
fee,
speed,
...rest
} = this.props

return (
<Box {...rest}>
<Box py={3}>
@@ -115,9 +116,11 @@ class PaySummaryOnChain extends React.Component {
<Text>
{fee} satoshis <FormattedMessage {...messages.fee_per_byte} />
</Text>
<Text fontSize="s">
<FormattedMessage {...messages[speed.toLowerCase() + '_description']} />
</Text>
<TransactionSpeedDesc
fontSize="s"
lndTargetConfirmations={lndTargetConfirmations}
speed={speed}
/>
</React.Fragment>
) : (
<FormattedMessage {...messages.fee_unknown} />

0 comments on commit d7d364d

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