Unverified Commit 04d134fe authored by Thibaut Sardan's avatar Thibaut Sardan Committed by GitHub
Browse files

Merge pull request #265 from paritytech/tbaut-erase-phrase

Make sure the recovery phrase is emptied upon process abortion
parents 87886f9e 25a466fc
Pipeline #44642 failed with stage
in 18 seconds
......@@ -17,7 +17,7 @@
'use strict';
import React from 'react';
import { Alert, findNodeHandle, SafeAreaView, StyleSheet, ScrollView, Text, View } from 'react-native';
import { Alert, SafeAreaView, ScrollView, StyleSheet, Text } from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
import { Subscribe } from 'unstated';
......@@ -37,6 +37,7 @@ export default class AccountRecover extends React.Component {
title: 'Recover Account',
headerBackTitle: 'Back'
};
render() {
return (
<Subscribe to={[AccountsStore]}>
......@@ -51,6 +52,11 @@ class AccountRecoverView extends React.Component {
super(...args);
}
componentWillUnmount = function () {
// called when the user goes back, or finishes the whole recovery process
this.props.accounts.updateNew({seed : ''});
}
render() {
const { accounts } = this.props;
const selected = accounts.getNew();
......@@ -86,9 +92,7 @@ class AccountRecoverView extends React.Component {
</Text>
<AccountSeed
valid={validateSeed(selected.seed, selected.validBip39Seed).valid}
onChangeText={seed => {
accounts.updateNew({ seed });
}}
onChangeText={seed => accounts.updateNew({ seed })}
value={selected.seed}
/>
<AccountCard
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment