diff --git a/src/components/ReceiveModal.js b/src/components/ReceiveModal.js index 65541bf9..18de7d98 100644 --- a/src/components/ReceiveModal.js +++ b/src/components/ReceiveModal.js @@ -4,7 +4,9 @@ import React, { PureComponent } from 'react' import Modal from 'components/base/Modal' -class ReceiveModal extends PureComponent { +type Props = {} + +class ReceiveModal extends PureComponent { render() { return receive modal } diff --git a/src/components/SendModal.js b/src/components/SendModal.js index 5bad380d..b267ec16 100644 --- a/src/components/SendModal.js +++ b/src/components/SendModal.js @@ -4,7 +4,9 @@ import React, { PureComponent } from 'react' import Modal from 'components/base/Modal' -class SendModal extends PureComponent { +type Props = {} + +class SendModal extends PureComponent { render() { return send modal } diff --git a/src/components/SideBar/Item.js b/src/components/SideBar/Item.js index 364da66b..c3d667d2 100644 --- a/src/components/SideBar/Item.js +++ b/src/components/SideBar/Item.js @@ -27,7 +27,7 @@ type Props = { openModal: Function, } -const mapStateToProps = (state, { modal }) => ({ +const mapStateToProps = (state, { modal }: any) => ({ // connect router here only to make components re-render // see https://github.com/ReactTraining/react-router/issues/4671 router: state.router, diff --git a/src/components/base/Modal.js b/src/components/base/Modal.js index b71fc377..58495853 100644 --- a/src/components/base/Modal.js +++ b/src/components/base/Modal.js @@ -10,7 +10,7 @@ import styled from 'styled-components' import { closeModal, isModalOpened } from 'reducers/modals' type Props = { - isOpened: boolean, + isOpened?: boolean, onClose: Function, children: any, } @@ -71,6 +71,10 @@ const Body = styled.div.attrs({ ` class Modal extends PureComponent { + static defaultProps = { + isOpened: false, + } + render() { const { isOpened, onClose, children } = this.props return ( diff --git a/src/internals/usb/wallet.js b/src/internals/usb/wallet.js index 3118bdcf..1f6eee8c 100644 --- a/src/internals/usb/wallet.js +++ b/src/internals/usb/wallet.js @@ -5,7 +5,7 @@ import Btc from '@ledgerhq/hw-app-btc' async function getWalletInfos(path, wallet) { if (wallet === 'btc') { - const comm = new CommNodeHid(path, true, 0, false) + const comm = await CommNodeHid.open(path) const btc = new Btc(comm) const walletInfos = await btc.getWalletPublicKey(`44'/0'/0'/0`) return walletInfos diff --git a/src/reducers/modals.js b/src/reducers/modals.js index bb55336a..a41e460f 100644 --- a/src/reducers/modals.js +++ b/src/reducers/modals.js @@ -43,7 +43,8 @@ export const closeModal = createAction('MODAL_CLOSE', name => ({ name })) // Selectors -export const isModalOpened = (state, name) => state.modals[name] && state.modals[name].isOpened +export const isModalOpened = (state: Object, name: string) => + state.modals[name] && state.modals[name].isOpened // Exporting reducer