allow blank passwords (#575)
This commit is contained in:
parent
044947d4ae
commit
d3f4abc50e
2 changed files with 12 additions and 18 deletions
|
@ -149,10 +149,6 @@ class FirstRunScreen extends React.PureComponent {
|
|||
const { notify, user, hasSyncedWallet } = this.props;
|
||||
const pageIndex = FirstRunScreen.pages.indexOf(this.state.currentPage);
|
||||
if (Constants.FIRST_RUN_PAGE_WALLET === this.state.currentPage) {
|
||||
if (!this.state.walletPassword || this.state.walletPassword.trim().length === 0) {
|
||||
return notify({ message: 'Please enter a wallet password' });
|
||||
}
|
||||
|
||||
// do apply sync to check if the password is valid
|
||||
if (hasSyncedWallet) {
|
||||
this.checkWalletPassword();
|
||||
|
@ -263,14 +259,13 @@ class FirstRunScreen extends React.PureComponent {
|
|||
setFreshPassword = () => {
|
||||
const { getSync, setClientSetting } = this.props;
|
||||
if (NativeModules.UtilityModule) {
|
||||
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, this.state.walletPassword);
|
||||
Lbry.account_encrypt({ new_password: this.state.walletPassword }).then(() => {
|
||||
Lbry.account_unlock({ password: this.state.walletPassword }).then(() => {
|
||||
// fresh account, new password set
|
||||
getSync(this.state.walletPassword);
|
||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
||||
this.closeFinalPage();
|
||||
});
|
||||
const newPassword = this.state.walletPassword ? this.state.walletPassword : '';
|
||||
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, newPassword);
|
||||
Lbry.account_encrypt({ new_password: newPassword }).then(() => {
|
||||
// fresh account, new password set
|
||||
getSync(newPassword);
|
||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
||||
this.closeFinalPage();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,11 @@ class SyncVerifyPage extends React.PureComponent {
|
|||
this.setState({ syncApplyStarted: true }, () => {
|
||||
if (!hasSyncedWallet) {
|
||||
// fresh account with no sync
|
||||
Lbry.account_encrypt({ new_password: this.state.password }).then(() => {
|
||||
Lbry.account_unlock({ password: this.state.password }).then(() => {
|
||||
getSync(this.state.password);
|
||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
||||
navigation.goBack();
|
||||
});
|
||||
const newPassword = this.state.password ? this.state.password : '';
|
||||
Lbry.account_encrypt({ new_password: newPassword }).then(() => {
|
||||
getSync(newPassword);
|
||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
||||
navigation.goBack();
|
||||
});
|
||||
} else {
|
||||
syncApply(syncHash, syncData, this.state.password);
|
||||
|
|
Loading…
Reference in a new issue