From eb913b03670355bfc89229d7e1516c321166e865 Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Mon, 8 Jan 2018 15:08:41 -0600 Subject: [PATCH] fix(lint): fix lint errors --- app/components/ChannelForm/Footer.js | 4 +- app/components/ChannelForm/StepOne.js | 3 +- app/components/ChannelForm/StepThree.js | 2 +- app/components/ChannelForm/StepTwo.js | 2 +- app/components/Channels/Channel.js | 4 +- app/components/Channels/ChannelForm.js | 7 ++- app/components/Channels/ChannelModal.js | 4 +- .../Channels/ClosedPendingChannel.js | 4 +- app/components/Channels/OpenPendingChannel.js | 4 +- app/components/Contacts/ClosingContact.js | 2 +- app/components/Contacts/ContactModal.js | 4 +- app/components/Contacts/ContactsForm.js | 30 +++++---- app/components/Contacts/Donut.js | 16 ++--- app/components/Contacts/LoadingContact.js | 2 +- app/components/Contacts/OfflineContact.js | 2 +- app/components/Contacts/OnlineContact.js | 2 +- app/components/Contacts/PendingContact.js | 2 +- app/components/Form/PayForm.js | 4 +- app/components/ModalRoot/ModalRoot.js | 4 +- .../ModalRoot/SuccessfulSendCoins.js | 4 +- app/components/Network/TransactionForm.js | 4 +- app/components/Peers/PeerModal.js | 4 +- app/components/Wallet/ReceiveModal.js | 4 +- app/components/Wallet/Wallet.js | 2 +- app/lnd/methods/channelController.js | 61 +++++++++---------- app/lnd/methods/index.js | 6 +- app/reducers/balance.js | 4 +- app/reducers/channels.js | 12 ++-- app/reducers/invoice.js | 2 +- app/reducers/network.js | 4 +- app/reducers/peers.js | 8 ++- app/reducers/ticker.js | 4 +- app/reducers/transaction.js | 4 +- app/routes/activity/components/Activity.js | 4 +- .../components/components/Invoice/Invoice.js | 4 +- .../components/components/Modal/Modal.js | 4 +- .../components/components/Payment/Payment.js | 4 +- .../components/Transaction/Transaction.js | 4 +- app/routes/contacts/components/Contacts.js | 4 +- app/routes/network/components/Network.js | 8 ++- internals/scripts/CheckBuiltsExist.js | 8 +-- 41 files changed, 154 insertions(+), 111 deletions(-) diff --git a/app/components/ChannelForm/Footer.js b/app/components/ChannelForm/Footer.js index 36675975..cba26b01 100644 --- a/app/components/ChannelForm/Footer.js +++ b/app/components/ChannelForm/Footer.js @@ -2,7 +2,9 @@ import React from 'react' import PropTypes from 'prop-types' import styles from './Footer.scss' -const Footer = ({ step, changeStep, stepTwoIsValid, submit }) => { +const Footer = ({ + step, changeStep, stepTwoIsValid, submit +}) => { if (step === 1) { return null } // See if the next button on step 2 should be active diff --git a/app/components/ChannelForm/StepOne.js b/app/components/ChannelForm/StepOne.js index b7aac4e1..9758cc27 100644 --- a/app/components/ChannelForm/StepOne.js +++ b/app/components/ChannelForm/StepOne.js @@ -58,8 +58,7 @@ class StepOne extends Component {

{peer.address}

{peer.pub_key}

- ) - )} + ))} ) diff --git a/app/components/ChannelForm/StepThree.js b/app/components/ChannelForm/StepThree.js index fef38172..d7045391 100644 --- a/app/components/ChannelForm/StepThree.js +++ b/app/components/ChannelForm/StepThree.js @@ -20,7 +20,7 @@ class StepThree extends Component {
( +const Channel = ({ + ticker, channel, closeChannel, currentTicker +}) => (
  • diff --git a/app/components/Channels/ChannelForm.js b/app/components/Channels/ChannelForm.js index 5334af6f..9f6cfd87 100644 --- a/app/components/Channels/ChannelForm.js +++ b/app/components/Channels/ChannelForm.js @@ -6,7 +6,9 @@ import CurrencyIcon from 'components/CurrencyIcon' import { usd, btc } from 'utils' import styles from './ChannelForm.scss' -const ChannelForm = ({ form, setForm, ticker, peers, openChannel, currentTicker }) => { +const ChannelForm = ({ + form, setForm, ticker, peers, openChannel, currentTicker +}) => { const submitClicked = () => { const { node_key, local_amt, push_amt } = form @@ -99,8 +101,7 @@ const ChannelForm = ({ form, setForm, ticker, peers, openChannel, currentTicker

    {peer.address}

    {peer.pub_key}

  • - ) - ) + )) : null } diff --git a/app/components/Channels/ChannelModal.js b/app/components/Channels/ChannelModal.js index f0cf8ae4..b4cc648c 100644 --- a/app/components/Channels/ChannelModal.js +++ b/app/components/Channels/ChannelModal.js @@ -4,7 +4,9 @@ import PropTypes from 'prop-types' import ReactModal from 'react-modal' import styles from './ChannelModal.scss' -const ChannelModal = ({ isOpen, resetChannel, channel, explorerLinkBase, closeChannel }) => { +const ChannelModal = ({ + isOpen, resetChannel, channel, explorerLinkBase, closeChannel +}) => { const customStyles = { overlay: { cursor: 'pointer', diff --git a/app/components/Channels/ClosedPendingChannel.js b/app/components/Channels/ClosedPendingChannel.js index 9e7eaf94..cf563c39 100644 --- a/app/components/Channels/ClosedPendingChannel.js +++ b/app/components/Channels/ClosedPendingChannel.js @@ -4,7 +4,9 @@ import PropTypes from 'prop-types' import { btc } from 'utils' import styles from './ClosedPendingChannel.scss' -const ClosedPendingChannel = ({ ticker, channel: { channel, closing_txid }, currentTicker, explorerLinkBase }) => ( +const ClosedPendingChannel = ({ + ticker, channel: { channel, closing_txid }, currentTicker, explorerLinkBase +}) => (
  • shell.openExternal(`${explorerLinkBase}/tx/${closing_txid}`)}>

    Closing Channel...

    diff --git a/app/components/Channels/OpenPendingChannel.js b/app/components/Channels/OpenPendingChannel.js index 523e1a86..50778d16 100644 --- a/app/components/Channels/OpenPendingChannel.js +++ b/app/components/Channels/OpenPendingChannel.js @@ -4,7 +4,9 @@ import PropTypes from 'prop-types' import { btc } from 'utils' import styles from './OpenPendingChannel.scss' -const OpenPendingChannel = ({ ticker, channel, currentTicker, explorerLinkBase }) => ( +const OpenPendingChannel = ({ + ticker, channel, currentTicker, explorerLinkBase +}) => (
  • shell.openExternal(`${explorerLinkBase}/tx/${channel.channel.channel_point.split(':')[0]}`)}>

    Opening Channel...

    diff --git a/app/components/Contacts/ClosingContact.js b/app/components/Contacts/ClosingContact.js index fe03fd36..9ae07b64 100644 --- a/app/components/Contacts/ClosingContact.js +++ b/app/components/Contacts/ClosingContact.js @@ -33,7 +33,7 @@ const ClosingContact = ({ channel }) => ( ) ClosingContact.propTypes = { - + } export default ClosingContact diff --git a/app/components/Contacts/ContactModal.js b/app/components/Contacts/ContactModal.js index ef2b78cf..63fd8b91 100644 --- a/app/components/Contacts/ContactModal.js +++ b/app/components/Contacts/ContactModal.js @@ -69,7 +69,7 @@ const ContactModal = ({
    - +
    { node && @@ -124,7 +124,7 @@ const ContactModal = ({ } ContactModal.propTypes = { - + } export default ContactModal diff --git a/app/components/Contacts/ContactsForm.js b/app/components/Contacts/ContactsForm.js index c945664c..03eece42 100644 --- a/app/components/Contacts/ContactsForm.js +++ b/app/components/Contacts/ContactsForm.js @@ -139,12 +139,11 @@ class ContactsForm extends React.Component {
      { - contactsform.searchQuery.length > 0 && filteredNetworkNodes.map(node => { - return ( -
    • -
      - { - node.alias.length > 0 ? + contactsform.searchQuery.length > 0 && filteredNetworkNodes.map(node => ( +
    • +
      + { + node.alias.length > 0 ?

      {node.alias.trim()} ({node.pub_key.substr(0, 10)}...{node.pub_key.substr(node.pub_key.length - 10)}) @@ -154,13 +153,12 @@ class ContactsForm extends React.Component { {node.pub_key}

      } -
      -
      - {renderRightSide(node)} -
      -
    • - ) - }) +
      +
      + {renderRightSide(node)} +
      +
    • + )) }
    @@ -187,7 +185,7 @@ class ContactsForm extends React.Component { Use - updateContactCapacity(event.target.value)} @@ -211,12 +209,12 @@ class ContactsForm extends React.Component { ) - } + } } ContactsForm.propTypes = { - + } export default ContactsForm diff --git a/app/components/Contacts/Donut.js b/app/components/Contacts/Donut.js index f82ded9d..f9066af1 100644 --- a/app/components/Contacts/Donut.js +++ b/app/components/Contacts/Donut.js @@ -7,15 +7,15 @@ const Donut = ({ value, size, strokewidth }) => { console.log('size: ', size) console.log('strokewidth: ', strokewidth) - const halfsize = (size * 0.5); - const radius = halfsize - (strokewidth * 0.5); - const circumference = 2 * Math.PI * radius; - const strokeval = ((value * circumference) / 100); - const dashval = (strokeval + ' ' + circumference); + const halfsize = (size * 0.5) + const radius = halfsize - (strokewidth * 0.5) + const circumference = 2 * Math.PI * radius + const strokeval = ((value * circumference) / 100) + const dashval = (`${strokeval} ${circumference}`) - const trackstyle = {strokeWidth: 5}; - const indicatorstyle = {strokeWidth: strokewidth, strokeDasharray: dashval} - const rotateval = 'rotate(-90 '+37.5+','+37.5+')'; + const trackstyle = { strokeWidth: 5 } + const indicatorstyle = { strokeWidth: strokewidth, strokeDasharray: dashval } + const rotateval = `rotate(-90 ${37.5},${37.5})` return ( diff --git a/app/components/Contacts/LoadingContact.js b/app/components/Contacts/LoadingContact.js index 6e9f3218..313e7f4e 100644 --- a/app/components/Contacts/LoadingContact.js +++ b/app/components/Contacts/LoadingContact.js @@ -29,7 +29,7 @@ const LoadingContact = ({ pubkey, isClosing }) => ( ) LoadingContact.propTypes = { - + } export default LoadingContact diff --git a/app/components/Contacts/OfflineContact.js b/app/components/Contacts/OfflineContact.js index fec6d975..0e042b9c 100644 --- a/app/components/Contacts/OfflineContact.js +++ b/app/components/Contacts/OfflineContact.js @@ -27,7 +27,7 @@ const OfflineContact = ({ channel, openContactModal }) => ( ) OfflineContact.propTypes = { - + } export default OfflineContact diff --git a/app/components/Contacts/OnlineContact.js b/app/components/Contacts/OnlineContact.js index 33eb7766..d36ce29a 100644 --- a/app/components/Contacts/OnlineContact.js +++ b/app/components/Contacts/OnlineContact.js @@ -27,7 +27,7 @@ const OnlineContact = ({ channel, openContactModal }) => ( ) OnlineContact.propTypes = { - + } export default OnlineContact diff --git a/app/components/Contacts/PendingContact.js b/app/components/Contacts/PendingContact.js index c5f0a01b..5ede3f9e 100644 --- a/app/components/Contacts/PendingContact.js +++ b/app/components/Contacts/PendingContact.js @@ -33,7 +33,7 @@ const PendingContact = ({ channel }) => ( ) PendingContact.propTypes = { - + } export default PendingContact diff --git a/app/components/Form/PayForm.js b/app/components/Form/PayForm.js index 725d312e..b67a26ac 100644 --- a/app/components/Form/PayForm.js +++ b/app/components/Form/PayForm.js @@ -9,7 +9,9 @@ import styles from './PayForm.scss' class PayForm extends Component { componentDidUpdate(prevProps) { - const { isOnchain, isLn, payform: { payInput }, fetchInvoice } = this.props + const { + isOnchain, isLn, payform: { payInput }, fetchInvoice + } = this.props // If on-chain, focus on amount to let user know it's editable if (isOnchain) { this.amountInput.focus() } diff --git a/app/components/ModalRoot/ModalRoot.js b/app/components/ModalRoot/ModalRoot.js index 5bff88ff..32157fcf 100644 --- a/app/components/ModalRoot/ModalRoot.js +++ b/app/components/ModalRoot/ModalRoot.js @@ -13,7 +13,9 @@ const MODAL_COMPONENTS = { /* other modals */ } -const ModalRoot = ({ modalType, modalProps, hideModal, currentTicker, currency }) => { +const ModalRoot = ({ + modalType, modalProps, hideModal, currentTicker, currency +}) => { if (!modalType) { return null } const SpecificModal = MODAL_COMPONENTS[modalType] diff --git a/app/components/ModalRoot/SuccessfulSendCoins.js b/app/components/ModalRoot/SuccessfulSendCoins.js index 0b6ae9ba..c0b101fe 100644 --- a/app/components/ModalRoot/SuccessfulSendCoins.js +++ b/app/components/ModalRoot/SuccessfulSendCoins.js @@ -5,7 +5,9 @@ import AnimatedCheckmark from 'components/AnimatedCheckmark' import { btc } from 'utils' import styles from './SuccessfulSendCoins.scss' -const SuccessfulSendCoins = ({ amount, addr, txid, hideModal, currentTicker, currency }) => { +const SuccessfulSendCoins = ({ + amount, addr, txid, hideModal, currentTicker, currency +}) => { const calculatedAmount = currency === 'usd' ? btc.satoshisToUsd(amount, currentTicker.price_usd) : btc.satoshisToBtc(amount) return ( diff --git a/app/components/Network/TransactionForm.js b/app/components/Network/TransactionForm.js index f681b14c..5c226057 100644 --- a/app/components/Network/TransactionForm.js +++ b/app/components/Network/TransactionForm.js @@ -3,7 +3,9 @@ import PropTypes from 'prop-types' import { btc } from 'utils' import styles from './TransactionForm.scss' -const TransactionForm = ({ updatePayReq, pay_req, loadingRoutes, payReqRoutes, setCurrentRoute, currentRoute }) => ( +const TransactionForm = ({ + updatePayReq, pay_req, loadingRoutes, payReqRoutes, setCurrentRoute, currentRoute +}) => (
    { +const PeerModal = ({ + isOpen, resetPeer, peer, disconnect +}) => { const customStyles = { overlay: { cursor: 'pointer', diff --git a/app/components/Wallet/ReceiveModal.js b/app/components/Wallet/ReceiveModal.js index 42adfd23..69663111 100644 --- a/app/components/Wallet/ReceiveModal.js +++ b/app/components/Wallet/ReceiveModal.js @@ -7,7 +7,9 @@ import { showNotification } from 'notifications' import { FaCopy, FaClose } from 'react-icons/lib/fa' import styles from './ReceiveModal.scss' -const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address, newAddress, qrCodeType, changeQrCode }) => { +const ReceiveModal = ({ + isOpen, hideActivityModal, pubkey, address, newAddress, qrCodeType, changeQrCode +}) => { const customStyles = { overlay: { cursor: 'pointer' diff --git a/app/components/Wallet/Wallet.js b/app/components/Wallet/Wallet.js index 62675fa9..425e2650 100644 --- a/app/components/Wallet/Wallet.js +++ b/app/components/Wallet/Wallet.js @@ -63,7 +63,7 @@ class Wallet extends Component {
    -
    this.setState({ modalOpen: true })}> +
    this.setState({ modalOpen: true })}> Address
    diff --git a/app/lnd/methods/channelController.js b/app/lnd/methods/channelController.js index 606d52a0..adc95d2c 100644 --- a/app/lnd/methods/channelController.js +++ b/app/lnd/methods/channelController.js @@ -15,7 +15,7 @@ const BufferUtil = bitcore.util.buffer */ export function connectAndOpen(lnd, meta, event, payload) { console.log('payload: ', payload) - + const { pubkey, host, localamt } = payload const channelPayload = { node_pubkey: BufferUtil.hexToBuffer(pubkey), @@ -25,38 +25,38 @@ export function connectAndOpen(lnd, meta, event, payload) { return new Promise((resolve, reject) => { listPeers(lnd, meta) - .then(({ peers }) => { - console.log('peers: ', peers) - - const peer = find(peers, { pub_key: pubkey }) - - if (peer) { - console.log('already have the peer. can open the channel now') - const call = lnd.openChannel(channelPayload, meta) - - call.on('data', data => event.sender.send('pushchannelupdated', { pubkey, data })) - call.on('error', error => event.sender.send('pushchannelerror', { pubkey, error: error.toString() })) - } else { - console.log('connect to the peer first') - connectPeer(lnd, meta, { pubkey, host }) - .then((data) => { - console.log('connectPeer data: ', data) + .then(({ peers }) => { + console.log('peers: ', peers) + + const peer = find(peers, { pub_key: pubkey }) + if (peer) { + console.log('already have the peer. can open the channel now') const call = lnd.openChannel(channelPayload, meta) - + call.on('data', data => event.sender.send('pushchannelupdated', { pubkey, data })) call.on('error', error => event.sender.send('pushchannelerror', { pubkey, error: error.toString() })) - }) - .catch(err => { - console.log('connect peer err: ', err) - event.sender.send('pushchannelerror', { pubkey, error: err.toString() }) - }) - } - }) - .catch(err => { - console.log('list peer err: ', err) - event.sender.send('pushchannelerror', { pubkey, error: err.toString() }) - }) + } else { + console.log('connect to the peer first') + connectPeer(lnd, meta, { pubkey, host }) + .then((data) => { + console.log('connectPeer data: ', data) + + const call = lnd.openChannel(channelPayload, meta) + + call.on('data', data => event.sender.send('pushchannelupdated', { pubkey, data })) + call.on('error', error => event.sender.send('pushchannelerror', { pubkey, error: error.toString() })) + }) + .catch((err) => { + console.log('connect peer err: ', err) + event.sender.send('pushchannelerror', { pubkey, error: err.toString() }) + }) + } + }) + .catch((err) => { + console.log('list peer err: ', err) + event.sender.send('pushchannelerror', { pubkey, error: err.toString() }) + }) }) } @@ -79,8 +79,7 @@ export function openChannel(lnd, meta, event, payload) { return new Promise((resolve, reject) => pushopenchannel(lnd, meta, event, res) .then(data => resolve(data)) - .catch(error => reject(error)) - ) + .catch(error => reject(error))) } diff --git a/app/lnd/methods/index.js b/app/lnd/methods/index.js index b8c7b1c3..f45ad419 100644 --- a/app/lnd/methods/index.js +++ b/app/lnd/methods/index.js @@ -74,8 +74,7 @@ export default function (lnd, meta, event, msg, data) { // [ { channels: [] }, { total_limbo_balance: 0, pending_open_channels: [], pending_closing_channels: [], pending_force_closing_channels: [] } ] Promise.all([channelController.listChannels, channelController.pendingChannels].map(func => func(lnd, meta))) .then(channelsData => - event.sender.send('receiveChannels', { channels: channelsData[0].channels, pendingChannels: channelsData[1] }) - ) + event.sender.send('receiveChannels', { channels: channelsData[0].channels, pendingChannels: channelsData[1] })) .catch(error => console.log('channels error: ', error)) break case 'transactions': @@ -123,8 +122,7 @@ export default function (lnd, meta, event, msg, data) { r_hash: new Buffer(newinvoice.r_hash, 'hex').toString('hex'), creation_date: Date.now() / 1000 }) - ) - ) + )) .catch((error) => { console.log('addInvoice error: ', error) event.sender.send('invoiceFailed', { error: error.toString() }) diff --git a/app/reducers/balance.js b/app/reducers/balance.js index 4da402fe..b8a74920 100644 --- a/app/reducers/balance.js +++ b/app/reducers/balance.js @@ -31,7 +31,9 @@ export const receiveBalance = (event, { walletBalance, channelBalance }) => (dis const ACTION_HANDLERS = { [GET_BALANCE]: state => ({ ...state, balanceLoading: true }), [RECEIVE_BALANCE]: (state, { walletBalance, channelBalance }) => ( - { ...state, balanceLoading: false, walletBalance, channelBalance } + { + ...state, balanceLoading: false, walletBalance, channelBalance + } ) } diff --git a/app/reducers/channels.js b/app/reducers/channels.js index 171dc77c..8af72d42 100644 --- a/app/reducers/channels.js +++ b/app/reducers/channels.js @@ -152,7 +152,9 @@ export const fetchChannels = () => async (dispatch) => { export const receiveChannels = (event, { channels, pendingChannels }) => dispatch => dispatch({ type: RECEIVE_CHANNELS, channels, pendingChannels }) // Send IPC event for opening a channel -export const openChannel = ({ pubkey, host, local_amt, push_amt }) => (dispatch) => { +export const openChannel = ({ + pubkey, host, local_amt, push_amt +}) => (dispatch) => { const localamt = btc.btcToSatoshis(local_amt) console.log('localamt: ', localamt) @@ -325,7 +327,9 @@ const ACTION_HANDLERS = { [GET_CHANNELS]: state => ({ ...state, channelsLoading: true }), [RECEIVE_CHANNELS]: (state, { channels, pendingChannels }) => ( - { ...state, channelsLoading: false, channels, pendingChannels } + { + ...state, channelsLoading: false, channels, pendingChannels + } ), [OPENING_CHANNEL]: state => ({ ...state, openingChannel: true }), @@ -339,13 +343,13 @@ const ACTION_HANDLERS = { [TOGGLE_CHANNEL_PULLDOWN]: state => ({ ...state, filterPulldown: !state.filterPulldown }), [CHANGE_CHANNEL_FILTER]: (state, { filter }) => ({ ...state, filterPulldown: false, filter }), - + [ADD_LOADING_PUBKEY]: (state, { pubkey }) => ({ ...state, loadingChannelPubkeys: [pubkey, ...state.loadingChannelPubkeys] }), [REMOVE_LOADING_PUBKEY]: (state, { pubkey }) => ({ ...state, loadingChannelPubkeys: state.loadingChannelPubkeys.filter(loadingPubkey => loadingPubkey !== pubkey) }), [ADD_ClOSING_CHAN_ID]: (state, { chanId }) => ({ ...state, closingChannelIds: [chanId, ...state.closingChannelIds] }), [REMOVE_ClOSING_CHAN_ID]: (state, { chanId }) => ({ ...state, closingChannelIds: state.closingChannelIds.filter(closingChanId => closingChanId !== chanId) }), - + [OPEN_CONTACT_MODAL]: (state, { channel }) => ({ ...state, contactModal: { isOpen: true, channel } }), [CLOSE_CONTACT_MODAL]: state => ({ ...state, contactModal: { isOpen: false, channel: null } }) } diff --git a/app/reducers/invoice.js b/app/reducers/invoice.js index 43932ccf..63c181e2 100644 --- a/app/reducers/invoice.js +++ b/app/reducers/invoice.js @@ -125,7 +125,7 @@ export const invoiceFailed = (event, { error }) => (dispatch) => { dispatch(setError(error)) } -// Listen for invoice updates pushed from backend from subscribeToInvoices +// Listen for invoice updates pushed from backend from subscribeToInvoices export const invoiceUpdate = (event, { invoice }) => (dispatch) => { dispatch({ type: UPDATE_INVOICE, invoice }) diff --git a/app/reducers/network.js b/app/reducers/network.js index 511ba41a..e8607d64 100644 --- a/app/reducers/network.js +++ b/app/reducers/network.js @@ -158,7 +158,9 @@ export const receiveInvoiceAndQueryRoutes = (event, { routes }) => dispatch => // ------------------------------------ const ACTION_HANDLERS = { [GET_DESCRIBE_NETWORK]: state => ({ ...state, networkLoading: true }), - [RECEIVE_DESCRIBE_NETWORK]: (state, { nodes, edges }) => ({ ...state, networkLoading: false, nodes, edges }), + [RECEIVE_DESCRIBE_NETWORK]: (state, { nodes, edges }) => ({ + ...state, networkLoading: false, nodes, edges + }), [GET_QUERY_ROUTES]: (state, { pubkey }) => ({ ...state, networkLoading: true, selectedNode: { pubkey, routes: [], currentRoute: {} } }), [RECEIVE_QUERY_ROUTES]: (state, { routes }) => ( diff --git a/app/reducers/peers.js b/app/reducers/peers.js index 7d88b705..9c1364ec 100644 --- a/app/reducers/peers.js +++ b/app/reducers/peers.js @@ -108,13 +108,17 @@ export const disconnectSuccess = (event, { pubkey }) => dispatch => dispatch({ t const ACTION_HANDLERS = { [DISCONNECT_PEER]: state => ({ ...state, disconnecting: true }), [DISCONNECT_SUCCESS]: (state, { pubkey }) => ( - { ...state, disconnecting: false, peer: null, peers: state.peers.filter(peer => peer.pub_key !== pubkey) } + { + ...state, disconnecting: false, peer: null, peers: state.peers.filter(peer => peer.pub_key !== pubkey) + } ), [DISCONNECT_FAILURE]: state => ({ ...state, disconnecting: false }), [CONNECT_PEER]: state => ({ ...state, connecting: true }), [CONNECT_SUCCESS]: (state, { peer }) => ( - { ...state, connecting: false, peerForm: { pubkey: '', host: '', isOpen: false }, peers: [...state.peers, peer] } + { + ...state, connecting: false, peerForm: { pubkey: '', host: '', isOpen: false }, peers: [...state.peers, peer] + } ), [CONNECT_FAILURE]: state => ({ ...state, connecting: false }), diff --git a/app/reducers/ticker.js b/app/reducers/ticker.js index c796a99f..32665a5a 100644 --- a/app/reducers/ticker.js +++ b/app/reducers/ticker.js @@ -68,7 +68,9 @@ const ACTION_HANDLERS = { [SET_CRYPTO]: (state, { crypto }) => ({ ...state, crypto }), [GET_TICKERS]: state => ({ ...state, tickerLoading: true }), [RECIEVE_TICKERS]: (state, { btcTicker, ltcTicker }) => ( - { ...state, tickerLoading: false, btcTicker, ltcTicker } + { + ...state, tickerLoading: false, btcTicker, ltcTicker + } ) } diff --git a/app/reducers/transaction.js b/app/reducers/transaction.js index 886bb200..c32ae56f 100644 --- a/app/reducers/transaction.js +++ b/app/reducers/transaction.js @@ -45,7 +45,9 @@ export const fetchTransactions = () => (dispatch) => { // Receive IPC event for payments export const receiveTransactions = (event, { transactions }) => dispatch => dispatch({ type: RECEIVE_TRANSACTIONS, transactions }) -export const sendCoins = ({ value, addr, currency, rate }) => (dispatch) => { +export const sendCoins = ({ + value, addr, currency, rate +}) => (dispatch) => { const amount = currency === 'usd' ? btc.btcToSatoshis(usd.usdToBtc(value, rate)) : btc.btcToSatoshis(value) dispatch(sendTransaction()) ipcRenderer.send('lnd', { msg: 'sendCoins', data: { amount, addr } }) diff --git a/app/routes/activity/components/Activity.js b/app/routes/activity/components/Activity.js index 497ab8f1..2af22af4 100644 --- a/app/routes/activity/components/Activity.js +++ b/app/routes/activity/components/Activity.js @@ -20,7 +20,9 @@ class Activity extends Component { } componentWillMount() { - const { fetchPayments, fetchInvoices, fetchTransactions, fetchBalance } = this.props + const { + fetchPayments, fetchInvoices, fetchTransactions, fetchBalance + } = this.props fetchBalance() fetchPayments() diff --git a/app/routes/activity/components/components/Invoice/Invoice.js b/app/routes/activity/components/components/Invoice/Invoice.js index 441d05e0..78f040c4 100644 --- a/app/routes/activity/components/components/Invoice/Invoice.js +++ b/app/routes/activity/components/components/Invoice/Invoice.js @@ -6,7 +6,9 @@ import { FaBolt, FaClockO } from 'react-icons/lib/fa' import { btc } from 'utils' import styles from '../Activity.scss' -const Invoice = ({ invoice, ticker, currentTicker, showActivityModal }) => ( +const Invoice = ({ + invoice, ticker, currentTicker, showActivityModal +}) => (
    showActivityModal('INVOICE', { invoice })}> { !invoice.settled ? diff --git a/app/routes/activity/components/components/Modal/Modal.js b/app/routes/activity/components/components/Modal/Modal.js index 4ec34da6..f6c3c97a 100644 --- a/app/routes/activity/components/components/Modal/Modal.js +++ b/app/routes/activity/components/components/Modal/Modal.js @@ -9,7 +9,9 @@ import Invoice from './Invoice' import styles from './Modal.scss' -const Modal = ({ modalType, modalProps, hideActivityModal, ticker, currentTicker }) => { +const Modal = ({ + modalType, modalProps, hideActivityModal, ticker, currentTicker +}) => { const MODAL_COMPONENTS = { TRANSACTION: Transaction, PAYMENT: Payment, diff --git a/app/routes/activity/components/components/Payment/Payment.js b/app/routes/activity/components/components/Payment/Payment.js index 8998fce7..ecf5ceed 100644 --- a/app/routes/activity/components/components/Payment/Payment.js +++ b/app/routes/activity/components/components/Payment/Payment.js @@ -6,7 +6,9 @@ import { FaBolt } from 'react-icons/lib/fa' import { btc } from 'utils' import styles from '../Activity.scss' -const Payment = ({ payment, ticker, currentTicker, showActivityModal }) => ( +const Payment = ({ + payment, ticker, currentTicker, showActivityModal +}) => (
    showActivityModal('PAYMENT', { payment })}>
    diff --git a/app/routes/activity/components/components/Transaction/Transaction.js b/app/routes/activity/components/components/Transaction/Transaction.js index e2d1b993..36fd7fff 100644 --- a/app/routes/activity/components/components/Transaction/Transaction.js +++ b/app/routes/activity/components/components/Transaction/Transaction.js @@ -6,7 +6,9 @@ import { FaChain } from 'react-icons/lib/fa' import { btc } from 'utils' import styles from '../Activity.scss' -const Transaction = ({ transaction, ticker, currentTicker, showActivityModal }) => ( +const Transaction = ({ + transaction, ticker, currentTicker, showActivityModal +}) => (
    showActivityModal('TRANSACTION', { transaction })}>
    diff --git a/app/routes/contacts/components/Contacts.js b/app/routes/contacts/components/Contacts.js index b3932b71..d24346ae 100644 --- a/app/routes/contacts/components/Contacts.js +++ b/app/routes/contacts/components/Contacts.js @@ -57,7 +57,7 @@ class Contacts extends Component { toggleFilterPulldown, changeFilter, nonActiveFilters, - + openContactsForm, openContactModal, closeContactModal, @@ -163,7 +163,7 @@ class Contacts extends Component { { currentChannels.length > 0 && currentChannels.map((channel, index) => { if (closingChannelIds.includes(channel.chan_id)) { - return + return } else if (Object.prototype.hasOwnProperty.call(channel, 'blocks_till_open')) { return } else if (Object.prototype.hasOwnProperty.call(channel, 'closing_txid')) { diff --git a/app/routes/network/components/Network.js b/app/routes/network/components/Network.js index c44aa2c3..22feae30 100644 --- a/app/routes/network/components/Network.js +++ b/app/routes/network/components/Network.js @@ -18,7 +18,9 @@ class Network extends Component { } componentDidUpdate(prevProps) { - const { payReqIsLn, network: { pay_req }, fetchInvoiceAndQueryRoutes, clearQueryRoutes } = this.props + const { + payReqIsLn, network: { pay_req }, fetchInvoiceAndQueryRoutes, clearQueryRoutes + } = this.props // If LN go retrieve invoice details if ((prevProps.network.pay_req !== pay_req) && payReqIsLn) { @@ -31,7 +33,9 @@ class Network extends Component { } componentWillUnmount() { - const { clearQueryRoutes, resetPayReq, clearSelectedChannels, clearSelectedPeers } = this.props + const { + clearQueryRoutes, resetPayReq, clearSelectedChannels, clearSelectedPeers + } = this.props clearQueryRoutes() resetPayReq() diff --git a/internals/scripts/CheckBuiltsExist.js b/internals/scripts/CheckBuiltsExist.js index 99ba4985..ef876c3c 100644 --- a/internals/scripts/CheckBuiltsExist.js +++ b/internals/scripts/CheckBuiltsExist.js @@ -9,15 +9,11 @@ function CheckBuildsExist() { const rendererPath = path.join(__dirname, '..', '..', 'app', 'dist', 'renderer.prod.js') if (!fs.existsSync(mainPath)) { - throw new Error(chalk.whiteBright.bgRed.bold( - 'The main process is not built yet. Build it by running "npm run build-main"' - )) + throw new Error(chalk.whiteBright.bgRed.bold('The main process is not built yet. Build it by running "npm run build-main"')) } if (!fs.existsSync(rendererPath)) { - throw new Error(chalk.whiteBright.bgRed.bold( - 'The renderer process is not built yet. Build it by running "npm run build-renderer"' - )) + throw new Error(chalk.whiteBright.bgRed.bold('The renderer process is not built yet. Build it by running "npm run build-renderer"')) } }