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