From 5e72ef920f8037fe6195ba3b59f6ba1942007a97 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 9 Aug 2019 12:14:43 -0400 Subject: [PATCH] fix: don't show short statuses Don't show blocks behind if it can catch up quickly. 1 less status. --- src/ui/component/splash/view.jsx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/ui/component/splash/view.jsx b/src/ui/component/splash/view.jsx index 1e4235bbb..03d315871 100644 --- a/src/ui/component/splash/view.jsx +++ b/src/ui/component/splash/view.jsx @@ -153,20 +153,29 @@ export default class SplashScreen extends React.PureComponent { } } else if (wallet && wallet.blocks_behind > 0) { const format = wallet.blocks_behind === 1 ? '%s block behind' : '%s blocks behind'; - this.setState({ - message: __('Blockchain Sync'), - details: `${__('Catching up...')} (${__(format, wallet.blocks_behind)})`, - }); + // Only show blocks behind if it takes more than a few seconds. + setTimeout(() => { + this.setState({ + message: __('Blockchain Sync'), + details: `${__('Catching up...')} (${__(format, wallet.blocks_behind)})`, + }); + }, 5000); if (this.timeout) { clearTimeout(this.timeout); } - } else if (wallet && wallet.blocks_behind === 0 && !status.is_running && startupStatus.database) { + } else if ( + wallet && + wallet.blocks_behind === 0 && + !wallet.is_locked && + !status.is_running && + startupStatus.database + ) { // Usually the transaction sync state, there's no status for this yet // Only show after user has been waiting 10 seconds // https://github.com/lbryio/lbry-sdk/issues/2314 setTimeout(() => { this.setState({ - message: 'Initializing', + message: 'Finalizing', details: 'Almost done...', }); }, 10000);