Fixed some eslint and flow

pull/200/head
Vladimir Volek 6 years ago
parent 35ce9b6a1d
commit 235f5cbdc3

@ -1,9 +1,23 @@
/* @flow */
import TrezorConnect from 'trezor-connect';
import type { GetState, Dispatch } from 'flowtype';
import type {
GetState, Dispatch, ThunkAction, AsyncAction,
} from 'flowtype';
import type { State } from 'reducers/SignVerifyReducer';
import * as NOTIFICATION from 'actions/constants/notification';
import * as SIGN_VERIFY from './constants/signVerify';
export type SignVerifyAction = {
type: typeof SIGN_VERIFY.SIGN_SUCCESS,
signature: string
} | {
type: typeof SIGN_VERIFY.SIGN_PROGRESS,
isSignProgress: boolean
} | {
type: typeof SIGN_VERIFY.CLEAR,
state: State
}
export const sign = (
path: Array<number>,
message: string,
@ -45,7 +59,7 @@ export const sign = (
actions: [{
label: 'Try again',
callback: () => {
dispatch(() => {});
dispatch(sign(path, message, hex));
},
},
],
@ -93,7 +107,7 @@ export const verify = (
{
label: 'Try again',
callback: () => {
dispatch(() => {});
dispatch(verify(address, message, signature, hex));
},
},
],
@ -106,6 +120,5 @@ export const verify = (
export const clear = (): ThunkAction => (dispatch: Dispatch): void => {
dispatch({
type: SIGN_VERIFY.CLEAR,
signature: '',
});
};

@ -17,7 +17,6 @@ import InvalidPin from 'components/modals/pin/Invalid';
import Passphrase from 'components/modals/passphrase/Passphrase';
import PassphraseType from 'components/modals/passphrase/Type';
import ConfirmSignTx from 'components/modals/confirm/SignTx';
import ConfirmSignMessage from 'components/modals/confirm/SignMessage';
import ConfirmUnverifiedAddress from 'components/modals/confirm/UnverifiedAddress';
import ForgetDevice from 'components/modals/device/Forget';
import RememberDevice from 'components/modals/device/Remember';
@ -91,9 +90,6 @@ const getDeviceContextModal = (props: Props) => {
case 'ButtonRequest_SignTx':
return <ConfirmSignTx device={modal.device} sendForm={props.sendForm} />;
case 'ButtonRequest_SignMessage':
return <ConfirmSignMessage device={modal.device} />;
case RECEIVE.REQUEST_UNVERIFIED:
return (
<ConfirmUnverifiedAddress

@ -25,6 +25,7 @@ import type { ModalAction } from 'actions/ModalActions';
import type { NotificationAction } from 'actions/NotificationActions';
import type { PendingTxAction } from 'actions/PendingTxActions';
import type { ReceiveAction } from 'actions/ReceiveActions';
import type { SignVerifyAction } from 'actions/SignVerifyActions';
import type { SendFormAction } from 'actions/SendFormActions';
import type { SummaryAction } from 'actions/SummaryActions';
import type { TokenAction } from 'actions/TokenActions';
@ -135,6 +136,7 @@ export type Action =
| DiscoveryAction
| StorageAction
| LogAction
| SignVerifyAction
| ModalAction
| NotificationAction
| PendingTxAction

@ -1,13 +1,10 @@
/* @flow */
import type { Action } from 'flowtype';
import type { NetworkToken } from './LocalStorageReducer';
import * as SIGN_VERIFY from '../actions/constants/signVerify';
export type State = {
details: boolean;
selectedToken: ?NetworkToken;
signature: string;
isSignProgress: boolean;
}
export const initialState: State = {

@ -341,9 +341,9 @@ const AccountSend = (props: Props) => {
options={feeLevels}
formatOptionLabel={option => (
<FeeOptionWrapper>
<P>{option.value}</P>
<P>{option.label}</P>
</FeeOptionWrapper>
<P>{option.value}</P>
<P>{option.label}</P>
</FeeOptionWrapper>
)}
/>
</InputRow>

@ -12,6 +12,12 @@ type OwnProps = {}
export type StateProps = {
selectedAccount: $ElementType<State, 'selectedAccount'>,
signature: string,
isSignProgress: boolean
}
export type DispatchProps = {
signVerifyActions: typeof SignVerifyActions,
}
export type Props = StateProps & DispatchProps;

@ -83,7 +83,7 @@ const StyledIcon = styled(Icon)`
`;
const ConfirmText = styled.div`
color: white;
color: white;
`;
class SignVerify extends Component {

Loading…
Cancel
Save