Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(launchpad): disable launch button when launch is in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Feb 8, 2019
1 parent 0a9e57d commit d4d2a8c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Home extends React.Component {
deleteWallet: PropTypes.func.isRequired,
lndConnect: PropTypes.object,
startLndError: PropTypes.object,
startingLnd: PropTypes.bool,
lightningGrpcActive: PropTypes.bool.isRequired,
walletUnlockerGrpcActive: PropTypes.bool.isRequired,
wallets: PropTypes.array.isRequired,
Expand Down Expand Up @@ -65,6 +66,7 @@ class Home extends React.Component {
deleteWallet,
startLnd,
startLndError,
startingLnd,
unlockWallet,
wallets,
setActiveWallet,
Expand Down Expand Up @@ -117,6 +119,7 @@ class Home extends React.Component {
wallet={wallet}
startLnd={startLnd}
stopLnd={stopLnd}
startingLnd={startingLnd}
lightningGrpcActive={lightningGrpcActive}
walletUnlockerGrpcActive={walletUnlockerGrpcActive}
startLndError={startLndError}
Expand Down
12 changes: 10 additions & 2 deletions app/components/Home/WalletLauncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class WalletLauncher extends React.Component {
wallet: PropTypes.object.isRequired,
deleteWallet: PropTypes.func.isRequired,
startLnd: PropTypes.func.isRequired,
startingLnd: PropTypes.bool.isRequired,
lightningGrpcActive: PropTypes.bool.isRequired,
walletUnlockerGrpcActive: PropTypes.bool.isRequired,
startLndError: PropTypes.object,
Expand Down Expand Up @@ -75,7 +76,7 @@ class WalletLauncher extends React.Component {
}

render() {
const { startLnd, wallet } = this.props
const { startLnd, startingLnd, wallet } = this.props

return (
<Box>
Expand All @@ -84,7 +85,14 @@ class WalletLauncher extends React.Component {
<WalletHeader wallet={wallet} />
</Box>
<Flex ml="auto" justifyContent="flex-end" flexDirection="column">
<Button type="submit" size="small" form={`wallet-settings-form-${wallet.id}`} ml={2}>
<Button
type="submit"
size="small"
disabled={startingLnd}
processing={startingLnd}
form={`wallet-settings-form-${wallet.id}`}
ml={2}
>
<FormattedMessage {...messages.launch_wallet_button_text} />
</Button>
</Flex>
Expand Down
1 change: 1 addition & 0 deletions app/containers/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const mapStateToProps = state => ({
lightningGrpcActive: state.lnd.lightningGrpcActive,
walletUnlockerGrpcActive: state.lnd.walletUnlockerGrpcActive,
startLndError: state.lnd.startLndError,
startingLnd: state.lnd.startingLnd,
unlockingWallet: state.lnd.unlockingWallet,
unlockWalletError: state.lnd.unlockWalletError
})
Expand Down

0 comments on commit d4d2a8c

Please sign in to comment.