1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-28 09:58:23 +00:00

Merge pull request #149 from trezor/eslint-fix

Fix some eslint errors
This commit is contained in:
Szymon Lesisz 2018-10-09 16:15:00 +02:00 committed by GitHub
commit 7ff2e8642d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 9 additions and 18 deletions

View File

@ -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",
"jest-fetch-mock": "^1.6.5",
"morgan": "^1.9.1",

View File

@ -7,7 +7,6 @@ import Icon from 'components/Icon';
import {
FONT_SIZE,
FONT_WEIGHT,
FONT_FAMILY,
TRANSITION,
} from 'config/variables';

View File

@ -60,8 +60,6 @@ class ConfirmUnverifiedAddress extends Component<Props> {
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<Props> {
<H2>{ deviceStatus }</H2>
<StyledP isSmaller>To prevent phishing attacks, you should verify the address on your TREZOR first. { claim } to continue with the verification process.</StyledP>
<Row>
<StyledButton onClick={() => this.verifyAddress()}>Try again</StyledButton>
<StyledButton onClick={() => (!this.props.selectedAccount.account ? this.verifyAddress() : 'false')}>Try again</StyledButton>
<StyledButton isWhite onClick={() => this.showUnverifiedAddress()}>Show unverified address</StyledButton>
</Row>
</Wrapper>

View File

@ -1,5 +1,4 @@
/* @flow */
import * as React from 'react';
import { Notification } from 'components/Notification';
import type { Props } from '../../index';

View File

@ -11,18 +11,16 @@ export type BlockchainNetwork = {
export type State = Array<BlockchainNetwork>;
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:

View File

@ -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());
}

View File

@ -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';

View File

@ -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';

View File

@ -25,7 +25,6 @@ import type {
type Props = {
device: ?TrezorDevice;
cancel: typeof RouterActions.selectFirstAvailableDevice,
}
const Wrapper = styled.section`

View File

@ -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,