From 4cf556adcebc508d30bafbcb0ba28478b0998aaf Mon Sep 17 00:00:00 2001 From: Alexey Padalko Date: Sat, 16 Mar 2019 20:26:44 +0200 Subject: [PATCH] fix(ui): disable open channel button on submit --- app/components/Channels/ChannelCreateForm.js | 6 +++++- app/containers/Channels/ChannelCreateForm.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/components/Channels/ChannelCreateForm.js b/app/components/Channels/ChannelCreateForm.js index 6b24cf0fea5..477f7f45c94 100644 --- a/app/components/Channels/ChannelCreateForm.js +++ b/app/components/Channels/ChannelCreateForm.js @@ -88,6 +88,7 @@ class ChannelCreateForm extends React.Component { currency: PropTypes.string.isRequired, currencyName: PropTypes.string.isRequired, intl: intlShape.isRequired, + isOpeningChannel: PropTypes.bool.isRequired, isQueryingFees: PropTypes.bool, onchainFees: PropTypes.shape({ fastestFee: PropTypes.number, @@ -320,6 +321,7 @@ class ChannelCreateForm extends React.Component { selectedNodeDisplayName, showNotification, updateContactFormSearchQuery, + isOpeningChannel, ...rest } = this.props const { step } = this.state @@ -354,7 +356,9 @@ class ChannelCreateForm extends React.Component { 0 && formState.invalid} + isNextButtonDisabled={ + isOpeningChannel || (formState.submits > 0 && formState.invalid) + } nextButtonText={ ({ currencyName: tickerSelectors.currencyName(state), isQueryingFees: state.pay.isQueryingFees, onchainFees: state.pay.onchainFees, + isOpeningChannel: state.channels.openingChannel, }) const mapDispatchToProps = {