Browse Source

fix(logs): remove console.logs

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
ff3e492037
  1. 4
      app/api/index.js
  2. 21
      app/components/LndSyncing/LndSyncing.js
  3. 56
      app/components/ModalRoot/WalletDetails.js
  4. 2
      app/components/Wallet/ReceiveModal.js
  5. 2
      app/components/Wallet/Wallet.js
  6. 2
      app/components/Wallet/index.js
  7. 4
      app/lnd/index.js
  8. 1
      app/lnd/lib/lightning.js
  9. 5
      app/lnd/methods/walletController.js
  10. 2
      app/lnd/subscribe/index.js
  11. 2
      app/reducers/balance.js
  12. 2
      app/reducers/ipc.js
  13. 8
      app/reducers/lnd.js
  14. 3
      app/reducers/transaction.js
  15. 2
      app/routes/activity/components/components/Modal/Modal.js
  16. 2
      app/routes/app/components/App.js

4
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)
}
}

21
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 {
<h3>zap</h3>
<div className={styles.loading}>
{!fetchingBlockHeight && <h4>{syncPercentage}%</h4>}
<div className={styles.spinner}>
</div>
<div className={styles.spinner} />
<h1>syncing your lightning node to the blockchain</h1>
</div>
<div className={styles.facts}>
@ -52,15 +51,13 @@ class LndSyncing extends Component {
</div>
<ul>
{
facts.map((facts, index) => {
return (
<li
className={`${styles.factButton} ${currentFact === index && styles.active}`}
key={index}
onClick={() => this.setState({ currentFact: index })}
/>
)
})
facts.map((facts, index) => (
<li
className={`${styles.factButton} ${currentFact === index && styles.active}`}
key={index}
onClick={() => this.setState({ currentFact: index })}
/>
))
}
</ul>
</div>

56
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 (
<div className={styles.walletdetails}>
<div className={styles.inner}>
<div className={styles.left}>
<section>
<h4>Node Alias</h4>
<h1>Testing</h1>
</section>
<section>
<h4>Node Public Key</h4>
<p className={styles.copytext}>{info.data.identity_pubkey}</p>
</section>
<section>
<h4>Deposit Address</h4>
<div className={styles.qrcode}>
<QRCode value={address} />
</div>
<p className={styles.copytext}>{address}</p>
</section>
</div>
<div className={styles.right}>
<section>
<h2>
const WalletDetails = ({ info, address }) => (
<div className={styles.walletdetails}>
<div className={styles.inner}>
<div className={styles.left}>
<section>
<h4>Node Alias</h4>
<h1>Testing</h1>
</section>
<section>
<h4>Node Public Key</h4>
<p className={styles.copytext}>{info.data.identity_pubkey}</p>
</section>
<section>
<h4>Deposit Address</h4>
<div className={styles.qrcode}>
<QRCode value={address} />
</div>
<p className={styles.copytext}>{address}</p>
</section>
</div>
<div className={styles.right}>
<section>
<h2>
Network
</h2>
</section>
</div>
</h2>
</section>
</div>
</div>
)
}
</div>
)
WalletDetails.propTypes = {
info: PropTypes.object.isRequired,

2
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')
}

2
app/components/Wallet/Wallet.js

@ -30,7 +30,7 @@ class Wallet extends Component {
return (
<div className={styles.wallet}>
{
(modalOpen &&
(modalOpen &&
<ReceiveModal
isOpen={modalOpen}
hideActivityModal={() => this.setState({ modalOpen: false })}

2
app/components/Wallet/index.js

@ -1,3 +1,3 @@
import Wallet from './Wallet'
export default Wallet
export default Wallet

4
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)
}
}

1
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)

5
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)
})

2
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)
}

2
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 })
}

2
app/reducers/ipc.js

@ -36,7 +36,7 @@ const ipc = createIpc({
lndSyncing,
lndSynced,
lndStdout,
receiveInfo,
receivePeers,

8
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 })
}
// ------------------------------------

3
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

2
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'

2
app/routes/app/components/App.js

@ -56,7 +56,7 @@ class App extends Component {
fetchingBlockHeight={lnd.fetchingBlockHeight}
syncPercentage={syncPercentage}
/>
)
)
}
if (!currentTicker) { return <LoadingBolt /> }

Loading…
Cancel
Save