1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-27 02:38:18 +00:00
This commit is contained in:
slowbackspace 2019-04-11 13:18:08 +02:00
parent c13e761b0e
commit 60e7244b7a
3 changed files with 10 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import { Notification, Link } from 'trezor-ui-components';
import Bignumber from 'bignumber.js';
import { FormattedMessage } from 'react-intl';
import { withRouter } from 'react-router-dom';
import type { ContextRouter } from 'react-router';
import l10nCommonMessages from 'views/common.messages';
import { matchPath } from 'react-router';
@ -12,7 +13,7 @@ import { getPattern } from 'support/routes';
import l10nMessages from './index.messages';
import type { Props } from '../../index';
export default withRouter((props: Props) => {
export default withRouter<Props>((props: {| ...Props, ...ContextRouter |}) => {
const { selectedAccount } = props;
const { account } = selectedAccount;
const { location } = props.router;

View File

@ -3,13 +3,15 @@ import * as React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as ImportAccountActions from 'actions/ImportAccountActions';
import type { State, Dispatch } from 'flowtype';
import type { State, Dispatch, TrezorDevice, Config } from 'flowtype';
import ImportView from './index';
type OwnProps = {|
children?: React.Node,
|};
export type StateProps = {|
device: ?TrezorDevice,
config: Config,
importAccount: $ElementType<State, 'importAccount'>,
|};

View File

@ -87,7 +87,11 @@ const Import = (props: Props) => {
!selectedNetwork || address === '' || props.importAccount.loading
}
onClick={() =>
props.importAddress(address, selectedNetwork.value, props.device)
props.importAddress(
address,
(selectedNetwork || {}).value,
props.device
)
}
>
Import