From 18c5743f89dd74e975ef69baae8cf21f91409d2a Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 17 Oct 2019 11:37:57 -0400 Subject: [PATCH] fix status being called continuosly after startup --- src/ui/component/splash/view.jsx | 50 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/src/ui/component/splash/view.jsx b/src/ui/component/splash/view.jsx index b315c8077..10b3c3dc2 100644 --- a/src/ui/component/splash/view.jsx +++ b/src/ui/component/splash/view.jsx @@ -130,41 +130,39 @@ export default class SplashScreen extends React.PureComponent { if (launchedModal === false && !modal) { 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 { - Lbry.resolve({ urls: 'lbry://one' }).then(() => { - return this.setState({ isRunning: true }, () => this.continueAppLaunch()); + return Lbry.resolve({ urls: 'lbry://one' }).then(() => { + this.setState({ isRunning: true }, () => this.continueAppLaunch()); }); } }); - } else if (blockchainHeaders) { - const blockChainHeaders = blockchainHeaders; - if (blockChainHeaders.download_progress < 100) { + } else { + if (blockchainHeaders) { + const blockChainHeaders = blockchainHeaders; + if (blockChainHeaders.download_progress < 100) { + this.setState({ + message: __('Blockchain Sync'), + details: `${__('Catching up...')} (${blockchainHeaders.download_progress}%)`, + }); + } + } else if (wallet && wallet.blocks_behind > 0) { + const amountBehind = + wallet.blocks_behind === 1 ? '%amountBehind% block behind' : '%amountBehind% blocks behind'; this.setState({ message: __('Blockchain Sync'), - details: `${__('Catching up...')} (${blockchainHeaders.download_progress}%)`, + details: `${__('Catching up...')} (${__(amountBehind, { amountBehind: wallet.blocks_behind })})`, + }); + } else if (wallet && wallet.blocks_behind === 0 && !status.is_running && startupStatus.database) { + this.setState({ + message: 'Finalizing', + details: 'Almost ready...', }); } - } else if (wallet && wallet.blocks_behind > 0) { - const amountBehind = wallet.blocks_behind === 1 ? '%amountBehind% block behind' : '%amountBehind% blocks behind'; - this.setState({ - message: __('Blockchain Sync'), - details: `${__('Catching up...')} (${__(amountBehind, { amountBehind: wallet.blocks_behind })})`, - }); - } else if (wallet && wallet.blocks_behind === 0 && !status.is_running && startupStatus.database) { - this.setState({ - message: 'Finalizing', - details: 'Almost ready...', - }); - } - setTimeout(() => { - this.updateStatus(); - }, 500); + setTimeout(() => { + this.updateStatus(); + }, 500); + } } runWithIncompatibleDaemon() {