update splash % call to use headers_synchronization_progress

This commit is contained in:
jessop 2019-12-03 13:47:03 -05:00 committed by Sean Yesmunt
parent 35ed493af4
commit 38c954853e
3 changed files with 4 additions and 13 deletions

View file

@ -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."
}
}

View file

@ -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);

View file

@ -146,19 +146,10 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
});
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({