Skip to content

Commit

Permalink
OnchainFeeInput: force users to set fee rate when suggestions disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed Oct 26, 2024
1 parent 6c60627 commit cb222ee
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 1 addition & 2 deletions components/OnchainFeeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) {
setErrorOccurredLoadingFees(true);
setLoading(false);
});
} else {
onChangeFee(DEFAULT_FEE);
}
}, []);

Expand Down Expand Up @@ -107,6 +105,7 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) {
setNewFee(text);
onChangeFee(text);
}}
error={!newFee || newFee === '0'}
/>
)}
</>
Expand Down
2 changes: 1 addition & 1 deletion views/Channels/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ export default class ChannelView extends React.Component<
deliveryAddress
)
}
disabled={satPerByte === '0'}
disabled={satPerByte === '0' || !satPerByte}
warning
/>
</View>
Expand Down
7 changes: 4 additions & 3 deletions views/OpenChannel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default class OpenChannel extends React.Component<
satAmount: '',
min_confs: 1,
spend_unconfirmed: false,
sat_per_vbyte: '2',
sat_per_vbyte: '',
privateChannel: true,
scidAlias: true,
simpleTaprootChannel: false,
Expand Down Expand Up @@ -1027,7 +1027,7 @@ export default class OpenChannel extends React.Component<
name: 'swap-horiz',
size: 25,
color:
sat_per_vbyte === '0'
sat_per_vbyte === '0' || !sat_per_vbyte
? themeColor('secondaryText')
: themeColor('background')
}}
Expand All @@ -1047,7 +1047,8 @@ export default class OpenChannel extends React.Component<
);
}}
disabled={
!connectPeerOnly && sat_per_vbyte === '0'
!connectPeerOnly &&
(sat_per_vbyte === '0' || !sat_per_vbyte)
}
/>
</View>
Expand Down
10 changes: 7 additions & 3 deletions views/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default class Send extends React.Component<SendProps, SendState> {
destination: destination || '',
amount: amount || '',
satAmount: '',
fee: '2',
fee: '',
utxos: [],
utxoBalance: 0,
confirmationTarget: '60',
Expand Down Expand Up @@ -1250,7 +1250,9 @@ export default class Send extends React.Component<SendProps, SendState> {
size: 25,
color:
totalBlockchainBalanceAccounts ===
0 || fee === '0'
0 ||
fee === '0' ||
!fee
? themeColor(
'secondaryText'
)
Expand All @@ -1261,7 +1263,9 @@ export default class Send extends React.Component<SendProps, SendState> {
}
disabled={
totalBlockchainBalanceAccounts ===
0 || fee === '0'
0 ||
fee === '0' ||
!fee
}
/>
</View>
Expand Down

0 comments on commit cb222ee

Please sign in to comment.