fix status being called continuosly after startup

This commit is contained in:
Sean Yesmunt 2019-10-17 11:37:57 -04:00
parent 4e70642163
commit 18c5743f89

View file

@ -130,18 +130,14 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
if (launchedModal === false && !modal) { if (launchedModal === false && !modal) {
this.setState({ launchedModal: true }, () => notifyUnlockWallet()); this.setState({ launchedModal: true }, () => notifyUnlockWallet());
} }
// If we cleared the error timeout due to a wallet being locked, make sure to start it back up
if (!this.timeout) {
this.adjustErrorTimeout();
}
} else { } else {
Lbry.resolve({ urls: 'lbry://one' }).then(() => { return Lbry.resolve({ urls: 'lbry://one' }).then(() => {
return this.setState({ isRunning: true }, () => this.continueAppLaunch()); this.setState({ isRunning: true }, () => this.continueAppLaunch());
}); });
} }
}); });
} else if (blockchainHeaders) { } else {
if (blockchainHeaders) {
const blockChainHeaders = blockchainHeaders; const blockChainHeaders = blockchainHeaders;
if (blockChainHeaders.download_progress < 100) { if (blockChainHeaders.download_progress < 100) {
this.setState({ this.setState({
@ -150,7 +146,8 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
}); });
} }
} else if (wallet && wallet.blocks_behind > 0) { } else if (wallet && wallet.blocks_behind > 0) {
const amountBehind = wallet.blocks_behind === 1 ? '%amountBehind% block behind' : '%amountBehind% blocks behind'; const amountBehind =
wallet.blocks_behind === 1 ? '%amountBehind% block behind' : '%amountBehind% blocks behind';
this.setState({ this.setState({
message: __('Blockchain Sync'), message: __('Blockchain Sync'),
details: `${__('Catching up...')} (${__(amountBehind, { amountBehind: wallet.blocks_behind })})`, details: `${__('Catching up...')} (${__(amountBehind, { amountBehind: wallet.blocks_behind })})`,
@ -166,6 +163,7 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
this.updateStatus(); this.updateStatus();
}, 500); }, 500);
} }
}
runWithIncompatibleDaemon() { runWithIncompatibleDaemon() {
const { hideModal } = this.props; const { hideModal } = this.props;