From 7aa69d4897fbcf520f637a7e4c6fbd2fc02b9807 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 30 Jul 2017 16:27:50 +0100 Subject: [PATCH] simple fix for cases where the status is 1 block behind --- ui/js/component/splash/view.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/js/component/splash/view.jsx b/ui/js/component/splash/view.jsx index a962d2f90..841f6f464 100644 --- a/ui/js/component/splash/view.jsx +++ b/ui/js/component/splash/view.jsx @@ -53,16 +53,23 @@ export class SplashScreen extends React.PureComponent { }); return; } - if (status.blockchain_status && status.blockchain_status.blocks_behind > 0) { + if ( + status.blockchain_status && + status.blockchain_status.blocks_behind > 0 + ) { + const format = status.blockchain_status.blocks_behind == 1 + ? "%s block behind" + : "%s blocks behind"; this.setState({ message: __("Blockchain Sync"), - details: __("%s blocks behind", status.blockchain_status.blocks_behind), + details: __(format, status.blockchain_status.blocks_behind), isLagging: startupStatus.is_lagging, }); } else { this.setState({ message: __("Network Loading"), - details: startupStatus.message + (startupStatus.is_lagging ? "" : "..."), + details: + startupStatus.message + (startupStatus.is_lagging ? "" : "..."), isLagging: startupStatus.is_lagging, }); }