quick fix for splash screen unlocking
This commit is contained in:
parent
70a6b7b056
commit
98ee0b1500
1 changed files with 33 additions and 29 deletions
|
@ -119,50 +119,54 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
|
||||||
|
|
||||||
// If the wallet is locked, stop doing anything and make the user input their password
|
// If the wallet is locked, stop doing anything and make the user input their password
|
||||||
if (status.is_running) {
|
if (status.is_running) {
|
||||||
// Clear the error timeout, it might sit on this step for a while until someone enters their password
|
return Lbry.wallet_status().then(walletStatus => {
|
||||||
if (this.timeout) {
|
|
||||||
clearTimeout(this.timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
Lbry.wallet_status().then(walletStatus => {
|
|
||||||
if (walletStatus.is_locked) {
|
if (walletStatus.is_locked) {
|
||||||
|
// Clear the error timeout, it might sit on this step for a while until someone enters their password
|
||||||
|
if (this.timeout) {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
}
|
||||||
// Make sure there isn't another active modal (like INCOMPATIBLE_DAEMON)
|
// Make sure there isn't another active modal (like INCOMPATIBLE_DAEMON)
|
||||||
if (launchedModal === false && !modal) {
|
if (launchedModal === false && !modal) {
|
||||||
this.setState({ launchedModal: true }, () => notifyUnlockWallet());
|
this.setState({ launchedModal: true }, () => notifyUnlockWallet());
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.updateStatus();
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Lbry.resolve({ urls: 'lbry://one' }).then(() => {
|
if (!this.timeout) {
|
||||||
|
this.adjustErrorTimeout();
|
||||||
|
}
|
||||||
|
|
||||||
|
Lbry.resolve({ urls: 'lbry://one' }).then(() => {
|
||||||
this.setState({ isRunning: true }, () => this.continueAppLaunch());
|
this.setState({ isRunning: true }, () => this.continueAppLaunch());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else if (blockchainHeaders) {
|
||||||
if (blockchainHeaders) {
|
const blockChainHeaders = blockchainHeaders;
|
||||||
const blockChainHeaders = blockchainHeaders;
|
if (blockChainHeaders.download_progress < 100) {
|
||||||
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';
|
|
||||||
this.setState({
|
this.setState({
|
||||||
message: __('Blockchain Sync'),
|
message: __('Blockchain Sync'),
|
||||||
details: `${__('Catching up...')} (${__(amountBehind, { amountBehind: wallet.blocks_behind })})`,
|
details: `${__('Catching up...')} (${blockchainHeaders.download_progress}%)`,
|
||||||
});
|
|
||||||
} else if (wallet && wallet.blocks_behind === 0 && !status.is_running && startupStatus.database) {
|
|
||||||
this.setState({
|
|
||||||
message: 'Finalizing',
|
|
||||||
details: 'Almost ready...',
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else if (wallet && wallet.blocks_behind > 0) {
|
||||||
setTimeout(() => {
|
const amountBehind = wallet.blocks_behind === 1 ? '%amountBehind% block behind' : '%amountBehind% blocks behind';
|
||||||
this.updateStatus();
|
this.setState({
|
||||||
}, 500);
|
message: __('Blockchain Sync'),
|
||||||
|
details: `${__('Catching up...')} (${__(amountBehind, { amountBehind: wallet.blocks_behind })})`,
|
||||||
|
});
|
||||||
|
} else if (wallet && wallet.blocks_behind === 0 && !status.is_running && startupStatus.database) {
|
||||||
|
this.setState({
|
||||||
|
message: 'Finalizing',
|
||||||
|
details: 'Almost ready...',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.updateStatus();
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
runWithIncompatibleDaemon() {
|
runWithIncompatibleDaemon() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue