From ff3e492037b87b50f8ce60a0f6ebebf3c2f4d267 Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Tue, 24 Oct 2017 16:24:06 -0500 Subject: [PATCH] fix(logs): remove console.logs --- app/api/index.js | 4 +- app/components/LndSyncing/LndSyncing.js | 21 +++---- app/components/ModalRoot/WalletDetails.js | 56 +++++++++---------- app/components/Wallet/ReceiveModal.js | 2 +- app/components/Wallet/Wallet.js | 2 +- app/components/Wallet/index.js | 2 +- app/lnd/index.js | 4 +- app/lnd/lib/lightning.js | 1 - app/lnd/methods/walletController.js | 5 +- app/lnd/subscribe/index.js | 2 - app/reducers/balance.js | 2 +- app/reducers/ipc.js | 2 +- app/reducers/lnd.js | 8 +-- app/reducers/transaction.js | 3 +- .../components/components/Modal/Modal.js | 2 +- app/routes/app/components/App.js | 2 +- 16 files changed, 53 insertions(+), 65 deletions(-) diff --git a/app/api/index.js b/app/api/index.js index e71c69df..d484600f 100644 --- a/app/api/index.js +++ b/app/api/index.js @@ -17,11 +17,11 @@ export function requestTickers(ids) { export function requestBlockHeight(id) { - const BASE_URL = `https://testnet-api.smartbit.com.au/v1/blockchain/blocks?limit=1` + const BASE_URL = 'https://testnet-api.smartbit.com.au/v1/blockchain/blocks?limit=1' return axios({ method: 'get', url: BASE_URL }) .then(response => response.data) .catch(error => error) -} \ No newline at end of file +} diff --git a/app/components/LndSyncing/LndSyncing.js b/app/components/LndSyncing/LndSyncing.js index 43acbde1..1f84b226 100644 --- a/app/components/LndSyncing/LndSyncing.js +++ b/app/components/LndSyncing/LndSyncing.js @@ -3,7 +3,7 @@ import styles from './LndSyncing.scss' class LndSyncing extends Component { constructor(props) { - super(props); + super(props); this.state = { facts: [ { @@ -41,8 +41,7 @@ class LndSyncing extends Component {

zap

{!fetchingBlockHeight &&

{syncPercentage}%

} -
-
+

syncing your lightning node to the blockchain

@@ -52,15 +51,13 @@ class LndSyncing extends Component {
diff --git a/app/components/ModalRoot/WalletDetails.js b/app/components/ModalRoot/WalletDetails.js index a2cad1aa..2789dd6a 100644 --- a/app/components/ModalRoot/WalletDetails.js +++ b/app/components/ModalRoot/WalletDetails.js @@ -3,38 +3,36 @@ import PropTypes from 'prop-types' import QRCode from 'qrcode.react' import styles from './WalletDetails.scss' -const WalletDetails = ({ info, address }) => { - return ( -
-
-
-
-

Node Alias

-

Testing

-
-
-

Node Public Key

-

{info.data.identity_pubkey}

-
-
-

Deposit Address

-
- -
-

{address}

-
-
-
-
-

+const WalletDetails = ({ info, address }) => ( +
+
+
+
+

Node Alias

+

Testing

+
+
+

Node Public Key

+

{info.data.identity_pubkey}

+
+
+

Deposit Address

+
+ +
+

{address}

+
+
+
+
+

Network -

-
-
+

+
- ) -} +
+) WalletDetails.propTypes = { info: PropTypes.object.isRequired, diff --git a/app/components/Wallet/ReceiveModal.js b/app/components/Wallet/ReceiveModal.js index ccce08e8..0da10b1d 100644 --- a/app/components/Wallet/ReceiveModal.js +++ b/app/components/Wallet/ReceiveModal.js @@ -21,7 +21,7 @@ const ReceiveModal = ({ isOpen, hideActivityModal, pubkey, address }) => { } } - const copyOnClick = data => { + const copyOnClick = (data) => { copy(data) showNotification('Noice', 'Successfully copied to clipboard') } diff --git a/app/components/Wallet/Wallet.js b/app/components/Wallet/Wallet.js index 0861c94c..a69789bd 100644 --- a/app/components/Wallet/Wallet.js +++ b/app/components/Wallet/Wallet.js @@ -30,7 +30,7 @@ class Wallet extends Component { return (
{ - (modalOpen && + (modalOpen && this.setState({ modalOpen: false })} diff --git a/app/components/Wallet/index.js b/app/components/Wallet/index.js index 6276fc4d..5b06b0cc 100644 --- a/app/components/Wallet/index.js +++ b/app/components/Wallet/index.js @@ -1,3 +1,3 @@ import Wallet from './Wallet' -export default Wallet \ No newline at end of file +export default Wallet diff --git a/app/lnd/index.js b/app/lnd/index.js index cb8d8a03..ef0d3623 100644 --- a/app/lnd/index.js +++ b/app/lnd/index.js @@ -5,9 +5,9 @@ import methods from './methods' export default (callback) => { const lnd = lightning(config.lightningRpc, config.lightningHost) - + const lndSubscribe = mainWindow => subscribe(mainWindow, lnd) const lndMethods = (event, msg, data) => methods(lnd, event, msg, data) callback(lndSubscribe, lndMethods) -} \ No newline at end of file +} diff --git a/app/lnd/lib/lightning.js b/app/lnd/lib/lightning.js index 3c3a30f8..5af4443a 100644 --- a/app/lnd/lib/lightning.js +++ b/app/lnd/lib/lightning.js @@ -5,7 +5,6 @@ import config from '../config' module.exports = (rpcpath, host) => { process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA' - console.log('RPC PATH: ', path.join(__dirname, 'rpc.proto')) const rpc = grpc.load(path.join(__dirname, 'rpc.proto')) const lndCert = fs.readFileSync(config.cert) diff --git a/app/lnd/methods/walletController.js b/app/lnd/methods/walletController.js index 903cbe07..a0c47677 100644 --- a/app/lnd/methods/walletController.js +++ b/app/lnd/methods/walletController.js @@ -72,10 +72,7 @@ export function getTransactions(lnd) { export function sendCoins(lnd, { addr, amount }) { return new Promise((resolve, reject) => { lnd.sendCoins({ addr, amount }, (err, data) => { - if (err) { - console.log('err: ', err) - reject(err) - } + if (err) { reject(err) } resolve(data) }) diff --git a/app/lnd/subscribe/index.js b/app/lnd/subscribe/index.js index ae1f08f5..170adf60 100644 --- a/app/lnd/subscribe/index.js +++ b/app/lnd/subscribe/index.js @@ -2,8 +2,6 @@ import subscribeToTransactions from './transactions' import subscribeToInvoices from './invoices' export default (mainWindow, lnd) => { - console.log('mainWindow: ', mainWindow) - console.log('lnd: ', lnd) subscribeToTransactions(mainWindow, lnd) subscribeToInvoices(mainWindow, lnd) } diff --git a/app/reducers/balance.js b/app/reducers/balance.js index 4b1b458e..4da402fe 100644 --- a/app/reducers/balance.js +++ b/app/reducers/balance.js @@ -21,7 +21,7 @@ export const fetchBalance = () => async (dispatch) => { } // Receive IPC event for balance -export const receiveBalance = (event, { walletBalance, channelBalance }) => dispatch => { +export const receiveBalance = (event, { walletBalance, channelBalance }) => (dispatch) => { dispatch({ type: RECEIVE_BALANCE, walletBalance, channelBalance }) } diff --git a/app/reducers/ipc.js b/app/reducers/ipc.js index d8329d1b..a0789e30 100644 --- a/app/reducers/ipc.js +++ b/app/reducers/ipc.js @@ -36,7 +36,7 @@ const ipc = createIpc({ lndSyncing, lndSynced, lndStdout, - + receiveInfo, receivePeers, diff --git a/app/reducers/lnd.js b/app/reducers/lnd.js index 613db848..532eee3b 100644 --- a/app/reducers/lnd.js +++ b/app/reducers/lnd.js @@ -22,7 +22,7 @@ export const RECEIVE_BLOCK_HEIGHT = 'RECEIVE_BLOCK_HEIGHT' export const lndSyncing = () => dispatch => dispatch({ type: START_SYNCING }) // Receive IPC event for LND stoping sync -export const lndSynced = () => dispatch => { +export const lndSynced = () => (dispatch) => { // Fetch data now that we know LND is synced dispatch(fetchTicker()) dispatch(fetchBalance()) @@ -60,11 +60,11 @@ export const fetchBlockHeight = () => async (dispatch) => { const ACTION_HANDLERS = { [START_SYNCING]: state => ({ ...state, syncing: true }), [STOP_SYNCING]: state => ({ ...state, syncing: false }), - + [RECEIVE_LINE]: (state, { lndBlockHeight }) => ({ ...state, lndBlockHeight }), - + [GET_BLOCK_HEIGHT]: state => ({ ...state, fetchingBlockHeight: true }), - [RECEIVE_BLOCK_HEIGHT]: (state, { blockHeight }) => ({ ...state, blockHeight, fetchingBlockHeight: false }), + [RECEIVE_BLOCK_HEIGHT]: (state, { blockHeight }) => ({ ...state, blockHeight, fetchingBlockHeight: false }) } // ------------------------------------ diff --git a/app/reducers/transaction.js b/app/reducers/transaction.js index cd305ffc..33821551 100644 --- a/app/reducers/transaction.js +++ b/app/reducers/transaction.js @@ -73,10 +73,9 @@ export const transactionError = () => (dispatch) => { // Listener for when a new transaction is pushed from the subscriber export const newTransaction = (event, { transaction }) => (dispatch) => { - console.log('transaction: ', transaction) // Fetch new balance dispatch(fetchBalance()) - + dispatch({ type: ADD_TRANSACTION, transaction }) // HTML 5 desktop notification for the new transaction diff --git a/app/routes/activity/components/components/Modal/Modal.js b/app/routes/activity/components/components/Modal/Modal.js index 2225a420..383316f5 100644 --- a/app/routes/activity/components/components/Modal/Modal.js +++ b/app/routes/activity/components/components/Modal/Modal.js @@ -12,7 +12,7 @@ const Modal = ({ modalType, modalProps, hideActivityModal, ticker, currentTicker PAYMENT: Payment, INVOICE: Invoice } - + const customStyles = { overlay: { cursor: 'pointer' diff --git a/app/routes/app/components/App.js b/app/routes/app/components/App.js index 1c842028..efa58d19 100644 --- a/app/routes/app/components/App.js +++ b/app/routes/app/components/App.js @@ -56,7 +56,7 @@ class App extends Component { fetchingBlockHeight={lnd.fetchingBlockHeight} syncPercentage={syncPercentage} /> - ) + ) } if (!currentTicker) { return }