Fix: remove unnecessary state variable for zeroConfLimit

This commit is contained in:
csrapr 2021-06-11 11:27:34 +01:00 committed by Josh Harvey
parent d1db0b95c8
commit c2e8ed612b

View file

@ -27,14 +27,12 @@ const WalletSchema = Yup.object().shape({
})
const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
let currentCurrency = ''
const widthAdjust = wizard ? 11 : 0
const viewCryptoCurrency = it => {
const currencyDisplay = R.compose(
R.prop(['display']),
R.find(R.propEq('code', it))
)(cryptoCurrencies)
currentCurrency = currencyDisplay
return currencyDisplay
}
const filterOptions = type => filterClass(type)(accounts || [])
@ -49,12 +47,6 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
filterCoins(it)(filterOptions(option))
)
const getZeroConfLimit = it => {
if (currentCurrency === 'Ethereum')
return <div style={classes.editDisabled}>{it}</div>
return it
}
return [
{
name: 'id',
@ -127,7 +119,8 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
name: 'zeroConfLimit',
size: 'sm',
stripe: true,
view: getZeroConfLimit,
view: (it, row) =>
row.id === 'ETH' ? <span style={classes.editDisabled}>{it}</span> : it,
input: NumberInput,
width: 190 - widthAdjust,
inputProps: {