From 09d32f2da5dd21a8fd3c9e43b3c4c6d0176286aa Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 16 Oct 2019 14:11:00 -0400 Subject: [PATCH] check Lbry.wallet_status for unlocked status instead of Lbry.status --- src/ui/component/snackBar/view.jsx | 6 ++++- src/ui/component/splash/view.jsx | 38 +++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/ui/component/snackBar/view.jsx b/src/ui/component/snackBar/view.jsx index 0fdf6eff8..671a87b10 100644 --- a/src/ui/component/snackBar/view.jsx +++ b/src/ui/component/snackBar/view.jsx @@ -1,7 +1,9 @@ // @flow +import * as ICONS from 'constants/icons'; import React from 'react'; import Button from 'component/button'; import classnames from 'classnames'; +import Icon from 'component/common/icon'; type Props = { removeSnack: any => void, @@ -48,7 +50,9 @@ class SnackBar extends React.PureComponent { })} >
-
+
+ +
{message}
{linkText && linkTarget && ( diff --git a/src/ui/component/splash/view.jsx b/src/ui/component/splash/view.jsx index 431ab7616..7578970f1 100644 --- a/src/ui/component/splash/view.jsx +++ b/src/ui/component/splash/view.jsx @@ -118,27 +118,29 @@ export default class SplashScreen extends React.PureComponent { const { wallet, startup_status: startupStatus, blockchain_headers: blockchainHeaders } = status; // If the wallet is locked, stop doing anything and make the user input their password - if (status.is_running && wallet && wallet.is_locked) { + if (status.is_running) { // 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) - if (launchedModal === false && !modal) { - this.setState({ launchedModal: true }, () => notifyUnlockWallet()); - } - } else if (status.is_running) { - // If we cleared the error timeout due to a wallet being locked, make sure to start it back up - if (!this.timeout) { - this.adjustErrorTimeout(); - } + Lbry.wallet_status().then(walletStatus => { + if (walletStatus.is_locked) { + // Make sure there isn't another active modal (like INCOMPATIBLE_DAEMON) + if (launchedModal === false && !modal) { + this.setState({ launchedModal: true }, () => notifyUnlockWallet()); + } - Lbry.resolve({ urls: 'lbry://one' }).then(() => { - this.setState({ isRunning: true }, () => this.continueAppLaunch()); + // If we cleared the error timeout due to a wallet being locked, make sure to start it back up + if (!this.timeout) { + this.adjustErrorTimeout(); + } + } else { + Lbry.resolve({ urls: 'lbry://one' }).then(() => { + this.setState({ isRunning: true }, () => this.continueAppLaunch()); + }); + } }); - - return; } else if (blockchainHeaders) { const blockChainHeaders = blockchainHeaders; if (blockChainHeaders.download_progress < 100) { @@ -153,13 +155,7 @@ export default class SplashScreen extends React.PureComponent { message: __('Blockchain Sync'), details: `${__('Catching up...')} (${__(amountBehind, { amountBehind: wallet.blocks_behind })})`, }); - } else if ( - wallet && - wallet.blocks_behind === 0 && - !wallet.is_locked && - !status.is_running && - startupStatus.database - ) { + } else if (wallet && wallet.blocks_behind === 0 && !status.is_running && startupStatus.database) { this.setState({ message: 'Finalizing', details: 'Almost ready...',