From 38c954853e5cb597e0c6c5c26d22bd1971721021 Mon Sep 17 00:00:00 2001 From: jessop Date: Tue, 3 Dec 2019 13:47:03 -0500 Subject: [PATCH] update splash % call to use headers_synchronization_progress --- static/app-strings.json | 2 +- ui/component/app/view.jsx | 2 +- ui/component/splash/view.jsx | 13 ++----------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 4c24ff7a4..34329c126 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -917,4 +917,4 @@ "Loading 3D model.": "Loading 3D model.", "Click here": "Click here", "PDF opened externally. %click_here% to open it again.": "PDF opened externally. %click_here% to open it again." -} \ No newline at end of file +} diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index 8431160c2..14e51631e 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -97,7 +97,7 @@ function App(props: Props) { if (!uploadCount) return; const handleBeforeUnload = event => { event.preventDefault(); - event.returnValue = 'magic'; + event.returnValue = 'magic'; // without setting this to something it doesn't work }; window.addEventListener('beforeunload', handleBeforeUnload); return () => window.removeEventListener('beforeunload', handleBeforeUnload); diff --git a/ui/component/splash/view.jsx b/ui/component/splash/view.jsx index 0cf693c97..e4a3ba2d2 100644 --- a/ui/component/splash/view.jsx +++ b/ui/component/splash/view.jsx @@ -146,19 +146,10 @@ export default class SplashScreen extends React.PureComponent { }); return; - } 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'; + } else if (wallet && wallet.blocks_behind > 0) { this.setState({ message: __('Blockchain Sync'), - details: `${__('Catching up...')} (${__(amountBehind, { amountBehind: wallet.blocks_behind })})`, + details: `${__('Catching up...')} (${wallet.headers_synchronization_progress}%)`, }); } else if (wallet && wallet.blocks_behind === 0 && !status.is_running && startupStatus.database) { this.setState({