From 1f588ff923b97901ae3f2cc9479c629c20d1b987 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sat, 29 Jul 2017 17:52:32 -0400 Subject: [PATCH] improve first run feedback --- ui/js/component/splash/view.jsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ui/js/component/splash/view.jsx b/ui/js/component/splash/view.jsx index 7cccd5bf0..a962d2f90 100644 --- a/ui/js/component/splash/view.jsx +++ b/ui/js/component/splash/view.jsx @@ -30,6 +30,7 @@ export class SplashScreen extends React.PureComponent { _updateStatusCallback(status) { const startupStatus = status.startup_status; + console.log(status); if (startupStatus.code == "started") { // Wait until we are able to resolve a name before declaring // that we are done. @@ -52,10 +53,19 @@ export class SplashScreen extends React.PureComponent { }); return; } - this.setState({ - details: startupStatus.message + (startupStatus.is_lagging ? "" : "..."), - isLagging: startupStatus.is_lagging, - }); + if (status.blockchain_status && status.blockchain_status.blocks_behind > 0) { + this.setState({ + message: __("Blockchain Sync"), + details: __("%s blocks behind", status.blockchain_status.blocks_behind), + isLagging: startupStatus.is_lagging, + }); + } else { + this.setState({ + message: __("Network Loading"), + details: startupStatus.message + (startupStatus.is_lagging ? "" : "..."), + isLagging: startupStatus.is_lagging, + }); + } setTimeout(() => { this.updateStatus(); }, 500);