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

bugfix/delete wallet with random password #2422

Merged
merged 9 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion app/components/Views/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ class Login extends PureComponent {
const { KeyringController } = Engine.context;
try {
await Engine.resetState();
await KeyringController.createNewVaultAndKeychain('');
await KeyringController.createNewVaultAndKeychain(`${Date.now()}`);
await KeyringController.setLocked();
this.deleteExistingUser();
} catch (error) {
Logger.log(error, `Failed to createNewVaultAndKeychain: ${error}`);
Expand Down
10 changes: 10 additions & 0 deletions app/components/Views/QRScanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { strings } from '../../../../locales/i18n';
import SharedDeeplinkManager from '../../../core/DeeplinkManager';
import AppConstants from '../../../core/AppConstants';
import { failedSeedPhraseRequirements, isValidMnemonic } from '../../../util/validators';
import Engine from '../../../core/Engine';

const styles = StyleSheet.create({
container: {
Expand Down Expand Up @@ -103,6 +104,15 @@ export default class QrScanner extends PureComponent {
this.props.navigation.goBack();
}
} else {
const { KeyringController } = Engine.context;
const isUnlocked = KeyringController.isUnlocked();

if (!isUnlocked) {
this.props.navigation.goBack();
Alert.alert(strings('qr_scanner.error'), strings('qr_scanner.attempting_to_scan_with_wallet_locked'));
this.mounted = false;
return;
}
// Let ethereum:address go forward
if (content.split('ethereum:').length > 1 && !parse(content).function_name) {
this.shouldReadBarCode = false;
Expand Down
1 change: 1 addition & 0 deletions locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@
"ok": "Ok",
"cancel": "Cancel",
"error": "Error",
"attempting_to_scan_with_wallet_locked": "Looks like you're trying to scan a QR code, you need to unlock your wallet to be able to use it.",
"attempting_sync_from_wallet_error": "Looks like you're trying to sync with the extension. In order to do so, you will need to erase your current wallet. \n\nOnce you've erased or reinstalled a fresh version of the app, select the option to \"Sync with MetaMask Extension\". Important! Before erasing your wallet, make sure you've backed up your recovery phrase."
},
"action_view": {
Expand Down