Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: accounts disappearing after password entry #1699

Merged
merged 2 commits into from
Jul 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/components/Views/ChoosePassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,17 @@ class ChoosePassword extends PureComponent {
// Get props to restore vault
const hdKeyring = KeyringController.state.keyrings[0];
const existingAccountCount = hdKeyring.accounts.length;
const preferencesControllerState = PreferencesController.state;
const selectedAddress = this.props.selectedAddress;
let preferencesControllerState = PreferencesController.state;

// Create previous accounts again
for (let i = 0; i < existingAccountCount - 1; i++) {
await KeyringController.addNewAccount();
}

// Reset preferencesControllerState
preferencesControllerState = PreferencesController.state;

// Set preferencesControllerState again
await PreferencesController.update(preferencesControllerState);
// Reselect previous selected account if still available
Expand Down