From ae729dcc467193c400b704daee83cb0407239be3 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 9 Oct 2018 15:20:57 +0200 Subject: [PATCH] Fixed some eslint errors --- package.json | 1 + src/components/inputs/Input/index.js | 1 - .../modals/confirm/UnverifiedAddress/index.js | 4 +--- .../notifications/Context/components/Static/index.js | 1 - src/reducers/BlockchainReducer.js | 11 ++++------- src/store.js | 4 ++-- src/views/Landing/components/InstallBridge/index.js | 1 - .../Account/Send/components/AdvancedForm/index.js | 1 - src/views/Wallet/views/FirmwareUpdate/index.js | 1 - webpack/local.babel.js | 2 +- 10 files changed, 9 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index c34df20c..a3a015c5 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "flow-webpack-plugin": "^1.2.0", "git-revision-webpack-plugin": "^3.0.3", "hdkey": "^0.8.0", + "history": "^4.7.2", "html-webpack-plugin": "^3.2.0", "http-server": "^0.11.1", "jest-fetch-mock": "^1.6.5", diff --git a/src/components/inputs/Input/index.js b/src/components/inputs/Input/index.js index c63a7351..cabfce5e 100644 --- a/src/components/inputs/Input/index.js +++ b/src/components/inputs/Input/index.js @@ -7,7 +7,6 @@ import Icon from 'components/Icon'; import { FONT_SIZE, FONT_WEIGHT, - FONT_FAMILY, TRANSITION, } from 'config/variables'; diff --git a/src/components/modals/confirm/UnverifiedAddress/index.js b/src/components/modals/confirm/UnverifiedAddress/index.js index 0555f190..0355ccb0 100644 --- a/src/components/modals/confirm/UnverifiedAddress/index.js +++ b/src/components/modals/confirm/UnverifiedAddress/index.js @@ -60,8 +60,6 @@ class ConfirmUnverifiedAddress extends Component { const { account, } = this.props.selectedAccount; - if (!account) return null; - this.props.modalActions.onCancel(); this.props.receiveActions.showAddress(account.addressPath); } @@ -104,7 +102,7 @@ class ConfirmUnverifiedAddress extends Component {

{ deviceStatus }

To prevent phishing attacks, you should verify the address on your TREZOR first. { claim } to continue with the verification process. - this.verifyAddress()}>Try again + (!this.props.selectedAccount.account ? this.verifyAddress() : 'false')}>Try again this.showUnverifiedAddress()}>Show unverified address diff --git a/src/components/notifications/Context/components/Static/index.js b/src/components/notifications/Context/components/Static/index.js index 47d30b24..5fca89d9 100644 --- a/src/components/notifications/Context/components/Static/index.js +++ b/src/components/notifications/Context/components/Static/index.js @@ -1,5 +1,4 @@ /* @flow */ -import * as React from 'react'; import { Notification } from 'components/Notification'; import type { Props } from '../../index'; diff --git a/src/reducers/BlockchainReducer.js b/src/reducers/BlockchainReducer.js index b4d4a12b..570c02a5 100644 --- a/src/reducers/BlockchainReducer.js +++ b/src/reducers/BlockchainReducer.js @@ -11,18 +11,16 @@ export type BlockchainNetwork = { export type State = Array; -export const initialState: State = []; +export const initialState: State = []; -const find = (state: State, name: string): number => { - return state.findIndex(b => b.name === name); -} +const find = (state: State, name: string): number => state.findIndex(b => b.name === name); const connect = (state: State, action: any): State => { const name = action.payload.coin.shortcut.toLowerCase(); const network: BlockchainNetwork = { name, connected: true, - } + }; const newState: State = [...state]; const index: number = find(newState, name); if (index >= 0) { @@ -38,7 +36,7 @@ const disconnect = (state: State, action: any): State => { const network: BlockchainNetwork = { name, connected: false, - } + }; const newState: State = [...state]; const index: number = find(newState, name); if (index >= 0) { @@ -52,7 +50,6 @@ const disconnect = (state: State, action: any): State => { export default (state: State = initialState, action: Action): State => { switch (action.type) { - case BLOCKCHAIN.CONNECT: return connect(state, action); case BLOCKCHAIN.ERROR: diff --git a/src/store.js b/src/store.js index 06257554..f5e985d6 100644 --- a/src/store.js +++ b/src/store.js @@ -11,7 +11,7 @@ import services from 'services'; import Raven from 'raven-js'; import RavenMiddleware from 'redux-raven-middleware'; -import type { Action, GetState, Store } from 'flowtype'; +import type { Action, GetState } from 'flowtype'; export const history: History = createHistory({ queryKey: false }); @@ -46,7 +46,7 @@ if (process.env.NODE_ENV === 'development') { collapsed: true, }); - const devToolsExtension: ?Function = window.devToolsExtension; + const { devToolsExtension }: ?Function = window; if (typeof devToolsExtension === 'function') { enhancers.push(devToolsExtension()); } diff --git a/src/views/Landing/components/InstallBridge/index.js b/src/views/Landing/components/InstallBridge/index.js index fcec71fc..f62645d3 100644 --- a/src/views/Landing/components/InstallBridge/index.js +++ b/src/views/Landing/components/InstallBridge/index.js @@ -3,7 +3,6 @@ import React, { Component } from 'react'; import styled from 'styled-components'; import colors from 'config/colors'; -import PropTypes from 'prop-types'; import { FONT_SIZE, FONT_WEIGHT } from 'config/variables'; import { Select } from 'components/Select'; import Link from 'components/Link'; diff --git a/src/views/Wallet/views/Account/Send/components/AdvancedForm/index.js b/src/views/Wallet/views/Account/Send/components/AdvancedForm/index.js index cd3bb65b..5ef43fc9 100644 --- a/src/views/Wallet/views/Account/Send/components/AdvancedForm/index.js +++ b/src/views/Wallet/views/Account/Send/components/AdvancedForm/index.js @@ -8,7 +8,6 @@ import Input from 'components/inputs/Input'; import Textarea from 'components/Textarea'; import Tooltip from 'components/Tooltip'; import Icon from 'components/Icon'; -import Link from 'components/Link'; import ICONS from 'config/icons'; import type { Props } from '../../Container'; diff --git a/src/views/Wallet/views/FirmwareUpdate/index.js b/src/views/Wallet/views/FirmwareUpdate/index.js index 21ae031e..376e6b01 100644 --- a/src/views/Wallet/views/FirmwareUpdate/index.js +++ b/src/views/Wallet/views/FirmwareUpdate/index.js @@ -25,7 +25,6 @@ import type { type Props = { device: ?TrezorDevice; - cancel: typeof RouterActions.selectFirstAvailableDevice, } const Wrapper = styled.section` diff --git a/webpack/local.babel.js b/webpack/local.babel.js index d760c9ac..3c4fe7eb 100644 --- a/webpack/local.babel.js +++ b/webpack/local.babel.js @@ -3,7 +3,7 @@ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import GitRevisionPlugin from 'git-revision-webpack-plugin'; import HtmlWebpackPlugin from 'html-webpack-plugin'; import CopyWebpackPlugin from 'copy-webpack-plugin'; -import MiniCssExtractPlugin from '../../trezor-connect/node_modules/mini-css-extract-plugin'; +import MiniCssExtractPlugin from '../../trezor-connect/node_modules/mini-css-extract-plugin'; // eslint-disable-line import { TREZOR_CONNECT_ROOT,