pull/495/head
slowbackspace 5 years ago
parent c13e761b0e
commit 60e7244b7a

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

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

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

Loading…
Cancel
Save