Commit 52ac5455 authored by Thibaut Sardan's avatar Thibaut Sardan Committed by Alexey
Browse files

Removed unused components, variables and functions (#196)

* fix(): cleaning unused components, variables and functions

* fix(): 2 more that I forgot
parent d8c21f5f
......@@ -17,8 +17,7 @@
'use strict';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { View, Text, StyleSheet, KeyboardAvoidingView } from 'react-native';
import { View, Text, StyleSheet } from 'react-native';
import { StackActions, NavigationActions } from 'react-navigation';
import { Subscribe } from 'unstated';
import AccountsStore from '../stores/AccountsStore';
......
......@@ -19,11 +19,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
Alert,
View,
Text,
StyleSheet,
KeyboardAvoidingView
} from 'react-native';
import debounce from 'debounce';
import { StackActions, NavigationActions } from 'react-navigation';
......@@ -32,7 +30,6 @@ import AccountsStore from '../stores/AccountsStore';
import ScannerStore from '../stores/ScannerStore';
import Background from '../components/Background';
import TextInput from '../components/TextInput';
import Button from '../components/Button';
import colors from '../colors';
export class AccountUnlockAndSign extends React.PureComponent {
......@@ -57,7 +54,7 @@ export class AccountUnlockAndSign extends React.PureComponent {
]
});
this.props.navigation.dispatch(resetAction);
} catch (e) {}
} catch (e) { }
}}
/>
)}
......@@ -95,30 +92,6 @@ export class AccountUnlock extends React.Component {
}
}
export class AccountUnlockAndChangePin extends React.PureComponent {
render() {
return (
<Subscribe to={[AccountsStore]}>
{accounts => (
<AccountUnlockView
{...this.props}
onChange={async pin => {
try {
if (await accounts.unlockAccount(accounts.getSelected(), pin)) {
this.props.navigation.navigate('AccountPin', {
isChange: true
});
}
} catch (e) {}
}}
accounts={accounts}
/>
)}
</Subscribe>
);
}
}
class AccountUnlockView extends React.PureComponent {
state = {
pin: ''
......@@ -130,7 +103,6 @@ class AccountUnlockView extends React.PureComponent {
};
render() {
const { accounts } = this.props;
return (
<View style={styles.body}>
<Background />
......
......@@ -18,10 +18,9 @@
import { Container } from 'unstated';
import debounce from 'debounce';
import { loadAccounts, saveAccount, deleteAccount } from '../util/db';
import { loadAccounts, saveAccount } from '../util/db';
import { encryptData, decryptData, brainWalletAddress } from '../util/native';
import { accountId, empty } from '../util/account';
import { NETWORK_TYPE, NETWORK_ID } from '../constants';
export type Account = {
name: string,
......@@ -117,7 +116,7 @@ export default class AccountsStore extends Container<AccountsState> {
});
}
async loadAccountTxs() {}
async loadAccountTxs() { }
async save(account, pin = null) {
try {
......@@ -134,7 +133,6 @@ export default class AccountsStore extends Container<AccountsState> {
}
async deleteAccount(account) {
// deleteAccount(account)
account.archived = true;
this.state.accounts.set(accountId(account), account);
this.setState({
......
......@@ -17,10 +17,9 @@
// @flow
import { Container } from 'unstated';
import transaction from '../util/transaction';
import { keccak, ethSign, brainWalletSign, decryptData } from '../util/native';
import { saveTx, loadAccountTxs } from '../util/db';
import { accountId } from '../util/account';``
import { NETWORK_TITLES, NETWORK_IDS } from '../constants';
import { keccak, brainWalletSign, decryptData } from '../util/native';
import { saveTx } from '../util/db';
import { NETWORK_TITLES } from '../constants';
import { type Account } from './AccountsStore';
type TXRequest = Object;
......@@ -76,7 +75,7 @@ export default class ScannerStore extends Container<ScannerState> {
if (!sender.encryptedSeed) {
throw new Error(
`No private key found for account ${
txRequest.data.account
txRequest.data.account
} found in your signer key storage for the ${networkTitle} chain.`
);
}
......
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