Merge pull request #93 from lbryio/fix-password-flow
fix error for auto-login and remove password warning
This commit is contained in:
commit
970b53ffdc
4 changed files with 17 additions and 26 deletions
|
@ -146,15 +146,6 @@ class WalletPage extends React.PureComponent {
|
||||||
<Icon name={this.state.revealPassword ? 'eye-slash' : 'eye'} size={16} style={firstRunStyle.revealIcon} />
|
<Icon name={this.state.revealPassword ? 'eye-slash' : 'eye'} size={16} style={firstRunStyle.revealIcon} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
{(!this.state.password || this.state.password.trim().length === 0) && (
|
|
||||||
<View style={firstRunStyle.passwordWarning}>
|
|
||||||
<Text style={firstRunStyle.passwordWarningText}>
|
|
||||||
{hasSyncedWallet
|
|
||||||
? __('If you did not provide a password, please press Use LBRY to continue.')
|
|
||||||
: __('You can proceed without a password, but this is not recommended.')}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
|
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
|
||||||
<View style={firstRunStyle.passwordStrength}>
|
<View style={firstRunStyle.passwordStrength}>
|
||||||
|
|
|
@ -28,6 +28,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||||
emailCollectTracked: false,
|
emailCollectTracked: false,
|
||||||
emailSubmitted: false,
|
emailSubmitted: false,
|
||||||
enterPasswordTracked: false,
|
enterPasswordTracked: false,
|
||||||
|
autoLoginTried: false,
|
||||||
isFirstRun: false,
|
isFirstRun: false,
|
||||||
launchUrl: null,
|
launchUrl: null,
|
||||||
languageLoaded: false,
|
languageLoaded: false,
|
||||||
|
@ -38,7 +39,6 @@ class FirstRunScreen extends React.PureComponent {
|
||||||
walletPassword: '',
|
walletPassword: '',
|
||||||
syncApplyStarted: false,
|
syncApplyStarted: false,
|
||||||
syncApplyCompleted: false,
|
syncApplyCompleted: false,
|
||||||
language: null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -126,8 +126,16 @@ class FirstRunScreen extends React.PureComponent {
|
||||||
|
|
||||||
if (this.state.syncApplyStarted && !syncApplyIsPending) {
|
if (this.state.syncApplyStarted && !syncApplyIsPending) {
|
||||||
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
|
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
|
||||||
notify({ message: __(syncApplyErrorMessage), isError: true });
|
if (this.state.autoLoginTried) {
|
||||||
this.setState({ showBottomContainer: true, syncApplyStarted: false, syncApplyCompleted: false });
|
// don't show the error message for auto-login if it fails
|
||||||
|
notify({ message: __(syncApplyErrorMessage), isError: true });
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
autoLoginTried: true,
|
||||||
|
showBottomContainer: true,
|
||||||
|
syncApplyStarted: false,
|
||||||
|
syncApplyCompleted: false,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setState({ syncApplyCompleted: true });
|
this.setState({ syncApplyCompleted: true });
|
||||||
// password successfully verified
|
// password successfully verified
|
||||||
|
|
|
@ -170,7 +170,6 @@ class SplashScreen extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateStatusCallback(status) {
|
_updateStatusCallback(status) {
|
||||||
console.log(status);
|
|
||||||
const { fetchSubscriptions, getSync, setClientSetting } = this.props;
|
const { fetchSubscriptions, getSync, setClientSetting } = this.props;
|
||||||
const startupStatus = status.startup_status;
|
const startupStatus = status.startup_status;
|
||||||
const walletStatus = status.wallet;
|
const walletStatus = status.wallet;
|
||||||
|
@ -222,7 +221,7 @@ class SplashScreen extends React.PureComponent {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const headerSyncProgress = walletStatus.headers_synchronization_progress;
|
const headerSyncProgress = walletStatus ? walletStatus.headers_synchronization_progress : null;
|
||||||
if (headerSyncProgress && headerSyncProgress < 100) {
|
if (headerSyncProgress && headerSyncProgress < 100) {
|
||||||
this.setState({
|
this.setState({
|
||||||
isDownloadingHeaders: true,
|
isDownloadingHeaders: true,
|
||||||
|
|
|
@ -21,6 +21,7 @@ class SyncVerifyPage extends React.PureComponent {
|
||||||
revealPassword: false,
|
revealPassword: false,
|
||||||
autoPassword: false,
|
autoPassword: false,
|
||||||
autoLoginAttempted: false,
|
autoLoginAttempted: false,
|
||||||
|
autoLoginTried: false,
|
||||||
autoLoginFlow: true,
|
autoLoginFlow: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,8 +68,10 @@ class SyncVerifyPage extends React.PureComponent {
|
||||||
|
|
||||||
if (this.state.syncApplyStarted && !syncApplyIsPending) {
|
if (this.state.syncApplyStarted && !syncApplyIsPending) {
|
||||||
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
|
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
|
||||||
notify({ message: __(syncApplyErrorMessage), isError: true });
|
if (this.state.autoLoginTried) {
|
||||||
this.setState({ syncApplyStarted: false, autoLoginFlow: false });
|
notify({ message: __(syncApplyErrorMessage), isError: true });
|
||||||
|
}
|
||||||
|
this.setState({ autoLoginTried: true, syncApplyStarted: false, autoLoginFlow: false });
|
||||||
} else {
|
} else {
|
||||||
// password successfully verified
|
// password successfully verified
|
||||||
this.setState({ syncApplyCompleted: true });
|
this.setState({ syncApplyCompleted: true });
|
||||||
|
@ -194,16 +197,6 @@ class SyncVerifyPage extends React.PureComponent {
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{(!this.state.password || this.state.password.trim().length === 0) && (
|
|
||||||
<View style={firstRunStyle.passwordWarning}>
|
|
||||||
<Text style={firstRunStyle.passwordWarningText}>
|
|
||||||
{hasSyncedWallet
|
|
||||||
? __('If you did not provide a password, please press Use LBRY to continue.')
|
|
||||||
: __('You can proceed without a password, but this is not recommended.')}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
|
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
|
||||||
<View style={firstRunStyle.passwordStrength}>
|
<View style={firstRunStyle.passwordStrength}>
|
||||||
<BarPasswordStrengthDisplay
|
<BarPasswordStrengthDisplay
|
||||||
|
|
Loading…
Add table
Reference in a new issue