Commit 7f268eac authored by Thibaut Sardan's avatar Thibaut Sardan
Browse files

fix(): revert onComponentUpdate and remove useless async/await

parent 4065a501
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "adler32"
version = "1.0.3"
......
......@@ -39,17 +39,12 @@ export default class AccountBackup extends React.PureComponent {
}
}
class AccountBackupView extends React.Component {
class AccountBackupView extends React.PureComponent {
constructor(...args) {
super(...args);
this.handleAppStateChange = this.handleAppStateChange.bind(this);
}
shouldComponentUpdate (nextProps) {
const hasEmptySeed = nextProps.accounts.state.newAccount.seed === "";
return !hasEmptySeed;
}
componentDidMount () {
AppState.addEventListener('change', this.handleAppStateChange);
}
......@@ -60,13 +55,13 @@ class AccountBackupView extends React.Component {
}
}
async componentWillUnmount () {
componentWillUnmount () {
const { accounts } = this.props;
const selected =
accounts.getNew().address && accounts.getNew().address.length
? accounts.getNew()
: accounts.getSelected();
await accounts.lockAccount(selected);
accounts.lockAccount(selected);
AppState.removeEventListener('change', this._handleAppStateChange);
}
......
......@@ -45,12 +45,6 @@ export default class AccountNew extends React.Component {
}
class AccountNewView extends React.Component {
shouldComponentUpdate (nextProps) {
const hasEmptySeed = nextProps.accounts.state.newAccount.seed === "";
return !hasEmptySeed;
}
render () {
const { accounts } = this.props;
const selected = accounts.getNew();
......
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