Add checks for 0 and exact balance

Otherwise, you get an ugly "internal error"
This commit is contained in:
Thomas Zarebczan 2018-03-15 02:44:44 -04:00 committed by GitHub
parent 9a3e251359
commit 9bcb75e234
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,6 +57,16 @@ class ChannelSection extends React.PureComponent {
return;
}
if (newChannelBid == 0) {
this.refs.newChannelName.showError(__('Bid value must be greater than 0.'));
return;
}
if (newChannelBid == balance) {
this.refs.newChannelName.showError(__('Please decrease your bid to account for transaction fees.'));
return;
}
this.setState({
creatingChannel: true,