From 235f5cbdc3ec65fa68618de95789da3008e90785 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Sat, 20 Oct 2018 12:12:29 +0200 Subject: [PATCH] Fixed some eslint and flow --- src/actions/SignVerifyActions.js | 21 +++++++++++++++---- src/components/modals/index.js | 4 ---- src/flowtype/index.js | 2 ++ src/reducers/SignVerifyReducer.js | 7 ++----- src/views/Wallet/views/Account/Send/index.js | 6 +++--- .../views/Account/SignVerify/Container.js | 6 ++++++ .../Wallet/views/Account/SignVerify/index.js | 2 +- 7 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/actions/SignVerifyActions.js b/src/actions/SignVerifyActions.js index a9eed358..d145d1f2 100644 --- a/src/actions/SignVerifyActions.js +++ b/src/actions/SignVerifyActions.js @@ -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, 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: '', }); }; \ No newline at end of file diff --git a/src/components/modals/index.js b/src/components/modals/index.js index 884c2916..54e37ae8 100644 --- a/src/components/modals/index.js +++ b/src/components/modals/index.js @@ -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 ; - case 'ButtonRequest_SignMessage': - return ; - case RECEIVE.REQUEST_UNVERIFIED: return ( { options={feeLevels} formatOptionLabel={option => ( -

{option.value}

-

{option.label}

-
+

{option.value}

+

{option.label}

+ )} /> diff --git a/src/views/Wallet/views/Account/SignVerify/Container.js b/src/views/Wallet/views/Account/SignVerify/Container.js index 07b22845..e047ac66 100644 --- a/src/views/Wallet/views/Account/SignVerify/Container.js +++ b/src/views/Wallet/views/Account/SignVerify/Container.js @@ -12,6 +12,12 @@ type OwnProps = {} export type StateProps = { selectedAccount: $ElementType, + signature: string, + isSignProgress: boolean +} + +export type DispatchProps = { + signVerifyActions: typeof SignVerifyActions, } export type Props = StateProps & DispatchProps; diff --git a/src/views/Wallet/views/Account/SignVerify/index.js b/src/views/Wallet/views/Account/SignVerify/index.js index ecaa6186..2ac3793a 100644 --- a/src/views/Wallet/views/Account/SignVerify/index.js +++ b/src/views/Wallet/views/Account/SignVerify/index.js @@ -83,7 +83,7 @@ const StyledIcon = styled(Icon)` `; const ConfirmText = styled.div` - color: white; + color: white; `; class SignVerify extends Component {