mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-07 14:50:52 +00:00
Fix flow
This commit is contained in:
parent
0999c99432
commit
6c2ae9c1be
@ -7,14 +7,16 @@ import * as NOTIFICATION from 'actions/constants/notification';
|
|||||||
import * as SIGN_VERIFY from './constants/signVerify';
|
import * as SIGN_VERIFY from './constants/signVerify';
|
||||||
|
|
||||||
export type SignVerifyAction = {
|
export type SignVerifyAction = {
|
||||||
type: typeof SIGN_VERIFY.SIGN_SUCCESS,
|
|
||||||
signature: string
|
|
||||||
} | {
|
|
||||||
type: typeof SIGN_VERIFY.SIGN_PROGRESS,
|
type: typeof SIGN_VERIFY.SIGN_PROGRESS,
|
||||||
isSignProgress: boolean
|
isSignProgress: boolean
|
||||||
} | {
|
} | {
|
||||||
type: typeof SIGN_VERIFY.CLEAR,
|
type: typeof SIGN_VERIFY.SIGN_SUCCESS,
|
||||||
state: State
|
signature: string
|
||||||
|
} | {
|
||||||
|
type: typeof SIGN_VERIFY.VERIFY_PROGRESS,
|
||||||
|
isVerifyProgress: boolean
|
||||||
|
} | {
|
||||||
|
type: typeof SIGN_VERIFY.CLEAR
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sign = (
|
export const sign = (
|
||||||
|
@ -4,7 +4,6 @@ import styled from 'styled-components';
|
|||||||
import Input from 'components/inputs/Input';
|
import Input from 'components/inputs/Input';
|
||||||
import Textarea from 'components/Textarea';
|
import Textarea from 'components/Textarea';
|
||||||
import { validateAddress } from 'utils/ethUtils';
|
import { validateAddress } from 'utils/ethUtils';
|
||||||
import Icon from 'components/Icon';
|
|
||||||
import Title from 'views/Wallet/components/Title';
|
import Title from 'views/Wallet/components/Title';
|
||||||
import Button from 'components/Button';
|
import Button from 'components/Button';
|
||||||
import Content from 'views/Wallet/components/Content';
|
import Content from 'views/Wallet/components/Content';
|
||||||
@ -70,10 +69,6 @@ class SignVerify extends Component<Props, State> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getPath() {
|
|
||||||
return this.props.selectedAccount.account.addressPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
getAddress() {
|
getAddress() {
|
||||||
let result = null;
|
let result = null;
|
||||||
const { selectedAccount } = this.props;
|
const { selectedAccount } = this.props;
|
||||||
@ -103,6 +98,8 @@ class SignVerify extends Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
if (!this.props.selectedAccount.account) return null;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
signVerifyActions,
|
signVerifyActions,
|
||||||
signature,
|
signature,
|
||||||
@ -152,7 +149,7 @@ class SignVerify extends Component<Props, State> {
|
|||||||
>Clear
|
>Clear
|
||||||
</Button>
|
</Button>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
onClick={() => signVerifyActions.sign(this.getPath(), this.state.signMessage)}
|
onClick={() => signVerifyActions.sign(this.props.selectedAccount.account.addressPath, this.state.signMessage)}
|
||||||
>Sign
|
>Sign
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
</RowButtons>
|
</RowButtons>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { H2 } from 'components/Heading';
|
import { H2 } from 'components/Heading';
|
||||||
import Button from 'components/Button';
|
|
||||||
import Paragraph from 'components/Paragraph';
|
import Paragraph from 'components/Paragraph';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
Loading…
Reference in New Issue
Block a user