fix: make empty 0conf settings uneditable
This commit is contained in:
parent
2d392eb64d
commit
712724eec0
1 changed files with 17 additions and 4 deletions
|
|
@ -175,6 +175,11 @@ const getAdvancedWalletElementsOverrides = (
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const has0Conf = R.complement(
|
||||||
|
/* NOTE: List of coins without 0conf settings. */
|
||||||
|
R.pipe(R.prop('id'), R.flip(R.includes)(['ETH', 'USDT']))
|
||||||
|
)
|
||||||
|
|
||||||
const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
|
const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
|
||||||
const widthAdjust = wizard ? 11 : 0
|
const widthAdjust = wizard ? 11 : 0
|
||||||
const viewCryptoCurrency = it => {
|
const viewCryptoCurrency = it => {
|
||||||
|
|
@ -254,7 +259,14 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
|
||||||
header: 'Confidence Checking',
|
header: 'Confidence Checking',
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
stripe: true,
|
stripe: true,
|
||||||
view: getDisplayName('zeroConf'),
|
view: (it, row) => {
|
||||||
|
const displayName = getDisplayName('zeroConf')(it, row)
|
||||||
|
return has0Conf(row) ? (
|
||||||
|
displayName
|
||||||
|
) : (
|
||||||
|
<span style={classes.editDisabled}>{displayName}</span>
|
||||||
|
)
|
||||||
|
},
|
||||||
input: Autocomplete,
|
input: Autocomplete,
|
||||||
width: 210 - widthAdjust,
|
width: 210 - widthAdjust,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
|
|
@ -263,7 +275,8 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
|
||||||
labelProp: 'display',
|
labelProp: 'display',
|
||||||
optionsLimit: null,
|
optionsLimit: null,
|
||||||
onChange
|
onChange
|
||||||
}
|
},
|
||||||
|
editable: has0Conf
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'zeroConfLimit',
|
name: 'zeroConfLimit',
|
||||||
|
|
@ -271,13 +284,13 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
stripe: true,
|
stripe: true,
|
||||||
view: (it, row) =>
|
view: (it, row) =>
|
||||||
row.id === 'ETH' ? <span style={classes.editDisabled}>{it}</span> : it,
|
has0Conf(row) ? it : <span style={classes.editDisabled}>{it}</span>,
|
||||||
input: NumberInput,
|
input: NumberInput,
|
||||||
width: 145 - widthAdjust,
|
width: 145 - widthAdjust,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 0
|
decimalPlaces: 0
|
||||||
},
|
},
|
||||||
editable: row => row.id !== 'ETH'
|
editable: has0Conf
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue