Skip to content

Commit

Permalink
fix(swap): optimize network fee check
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Nov 19, 2020
1 parent 272e904 commit 78412c6
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ class PreviewSwap extends PureComponent<InjectedFormProps<{}, Props> & Props> {
}

networkFee = value => {
return value.coin === 'BTC' || value.coin === 'BCH'
? value.selection.fee
: value.fee
return value
? value.coin === 'BTC' || value.coin === 'BCH'
? value.selection.fee
: value.fee
: 0
}

render () {
Expand Down Expand Up @@ -174,7 +176,7 @@ class PreviewSwap extends PureComponent<InjectedFormProps<{}, Props> & Props> {
{coinToString({
value: convertBaseToStandard(
BASE.baseCoin,
value ? this.networkFee(value) : 0
this.networkFee(value)
),
unit: { symbol: coins[BASE.baseCoin].coinTicker }
})}
Expand Down

0 comments on commit 78412c6

Please sign in to comment.