fix: ๐Ÿ› close channel params

This commit is contained in:
Anthony Potdevin 2020-11-08 00:21:48 +01:00
parent bd9e224c28
commit 8bc1cbc591
No known key found for this signature in database
GPG key ID: 4403F1DFBE779457

View file

@ -86,7 +86,7 @@ export const CloseChannel = ({
<SubTitle>Are you sure you want to close the channel?</SubTitle>
<ColorButton
fullWidth={true}
disabled={loading}
disabled={loading || !amount}
loading={loading}
withMargin={'16px 4px 4px'}
color={'red'}
@ -95,11 +95,9 @@ export const CloseChannel = ({
variables: {
id: channelId,
forceClose: isForce,
...(isType !== 'none'
? isType === 'fee'
? { tokens: amount }
: { target: amount }
: {}),
...(isType === 'target'
? { target: amount }
: { tokens: amount }),
},
})
}
@ -146,10 +144,27 @@ export const CloseChannel = ({
<MultiButton>
{fetchFees &&
!dontShow &&
renderButton(() => setIsType('none'), 'Auto', isType === 'none')}
{renderButton(() => setIsType('fee'), 'Fee', isType === 'fee')}
renderButton(
() => {
setAmount(0);
setIsType('none');
},
'Auto',
isType === 'none'
)}
{renderButton(
() => setIsType('target'),
() => {
setAmount(0);
setIsType('fee');
},
'Fee',
isType === 'fee'
)}
{renderButton(
() => {
setAmount(0);
setIsType('target');
},
'Target',
isType === 'target'
)}