Browse Source

fix(sync): ensure grpc active before leaving sync

Do not progress from the sync screen to the app screen until we have
determined that the main gRPC connection has been established.
renovate/lint-staged-8.x
Tom Kirkpatrick 6 years ago
parent
commit
20c8d969f5
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 6
      app/components/Syncing/Syncing.js
  2. 1
      app/containers/Syncing.js

6
app/components/Syncing/Syncing.js

@ -20,7 +20,8 @@ class Syncing extends Component {
syncPercentage: PropTypes.number, syncPercentage: PropTypes.number,
blockHeight: PropTypes.number, blockHeight: PropTypes.number,
lndBlockHeight: PropTypes.number, lndBlockHeight: PropTypes.number,
lndCfilterHeight: PropTypes.number lndCfilterHeight: PropTypes.number,
lightningGrpcActive: PropTypes.bool
} }
state = { state = {
@ -58,12 +59,13 @@ class Syncing extends Component {
blockHeight, blockHeight,
lndBlockHeight, lndBlockHeight,
lndCfilterHeight, lndCfilterHeight,
lightningGrpcActive,
intl, intl,
theme theme
} = this.props } = this.props
let { syncMessageDetail, syncMessageExtraDetail } = this.state let { syncMessageDetail, syncMessageExtraDetail } = this.state
if (syncStatus === 'complete') { if (lightningGrpcActive && syncStatus === 'complete') {
return <Redirect to="/app" /> return <Redirect to="/app" />
} }

1
app/containers/Syncing.js

@ -15,6 +15,7 @@ const mapStateToProps = state => ({
blockHeight: state.lnd.blockHeight, blockHeight: state.lnd.blockHeight,
lndBlockHeight: state.lnd.lndBlockHeight, lndBlockHeight: state.lnd.lndBlockHeight,
lndCfilterHeight: state.lnd.lndCfilterHeight, lndCfilterHeight: state.lnd.lndCfilterHeight,
lightningGrpcActive: state.lnd.lightningGrpcActive,
isLoading: infoSelectors.infoLoading(state) || onboardingSelectors.startingLnd(state) isLoading: infoSelectors.infoLoading(state) || onboardingSelectors.startingLnd(state)
}) })

Loading…
Cancel
Save