Browse Source

fix(loading): fix loading bolt

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
335646f0f7
  1. BIN
      app/bin/darwin/lnd
  2. 1
      app/components/LoadingBolt/LoadingBolt.js
  3. 3
      app/lnd/index.js
  4. 1
      app/lnd/lib/lightning.js
  5. 1
      app/lnd/methods/index.js
  6. 1
      app/lnd/methods/invoicesController.js
  7. 5
      app/main.dev.js
  8. 5
      app/reducers/invoice.js
  9. 5
      app/reducers/payment.js
  10. 2
      app/routes/activity/components/Activity.js
  11. 7
      app/routes/app/components/App.js
  12. 3
      app/routes/app/containers/AppContainer.js
  13. 15
      app/store/configureStore.prod.js

BIN
resources/binaries/lnd → app/bin/darwin/lnd

Binary file not shown.

1
app/components/LoadingBolt/LoadingBolt.js

@ -6,6 +6,7 @@ import styles from './LoadingBolt.scss'
const LoadingBolt = () => (
<div className={styles.container}>
<div className={styles.content}>
<Isvg className={styles.bolt} src={path.join(__dirname, '..', 'resources/cloudbolt.svg')} />
<h1>loading</h1>
</div>
</div>

3
app/lnd/index.js

@ -4,11 +4,8 @@ import subscribe from './subscribe'
import methods from './methods'
export default (callback) => {
console.log('here')
const lnd = lightning(config.lightningRpc, config.lightningHost)
console.log('lnd: ', lnd)
const lndSubscribe = mainWindow => subscribe(mainWindow, lnd)
const lndMethods = (event, msg, data) => methods(lnd, event, msg, data)

1
app/lnd/lib/lightning.js

@ -6,7 +6,6 @@ import config from '../config'
module.exports = (rpcpath, host) => {
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA'
console.log('PATH: ', path.join(__dirname, 'rpc.proto'))
const rpc = grpc.load(path.join(__dirname, 'rpc.proto'))
const lndCert = fs.readFileSync(config.cert)

1
app/lnd/methods/index.js

@ -24,7 +24,6 @@ import * as networkController from './networkController'
export default function (lnd, event, msg, data) {
console.log('MSG: ', msg)
switch (msg) {
case 'info':
networkController.getInfo(lnd)

1
app/lnd/methods/invoicesController.js

@ -27,7 +27,6 @@ export function listInvoices(lnd) {
lnd.listInvoices({}, (err, data) => {
if (err) { reject(err) }
console.log('invoices data: ', data)
resolve(data)
})
})

5
app/main.dev.js

@ -13,6 +13,7 @@
*/
import { app, BrowserWindow, ipcMain } from 'electron'
import fs from 'fs'
import path from 'path'
import { spawn, exec } from 'child_process'
import { lookup } from 'ps-node'
import { userInfo } from 'os'
@ -115,8 +116,9 @@ app.on('ready', async () => {
// After the certs are generated, it's time to start LND
console.log('STARTING LND')
console.log('BINARY: ', path.join(__dirname, 'bin', 'darwin', 'lnd'))
neutrino = spawn(
'resources/binaries/lnd',
`${path.join(__dirname, 'bin', 'darwin', 'lnd')}`,
[
'--bitcoin.active',
'--bitcoin.testnet',
@ -127,6 +129,7 @@ app.on('ready', async () => {
'--no-macaroons'
]
)
.on('error', error => console.log(`lnd error: ${error}`))
.on('close', code => console.log(`lnd shutting down ${code}`))
// Let the front end know we have started syncing LND

5
app/reducers/invoice.js

@ -95,10 +95,7 @@ export const fetchInvoices = () => (dispatch) => {
}
// Receive IPC event for invoices
export const receiveInvoices = (event, { invoices }) => dispatch => {
console.log('invoices: ', invoices)
dispatch({ type: RECEIVE_INVOICES, invoices })
}
export const receiveInvoices = (event, { invoices }) => dispatch => dispatch({ type: RECEIVE_INVOICES, invoices })
// Send IPC event for creating an invoice
export const createInvoice = (amount, memo, currency, rate) => (dispatch) => {

5
app/reducers/payment.js

@ -58,10 +58,7 @@ export const fetchPayments = () => (dispatch) => {
}
// Receive IPC event for payments
export const receivePayments = (event, { payments }) => dispatch => {
console.log('payments: ', payments)
dispatch({ type: RECEIVE_PAYMENTS, payments })
}
export const receivePayments = (event, { payments }) => dispatch => dispatch({ type: RECEIVE_PAYMENTS, payments })
export const payInvoice = paymentRequest => (dispatch) => {
dispatch(sendPayment())

2
app/routes/activity/components/Activity.js

@ -54,8 +54,6 @@ class Activity extends Component {
nonActiveFilters
} = this.props
console.log('invoiceLoading: ', invoiceLoading)
console.log('paymentLoading: ', paymentLoading)
if (invoiceLoading || paymentLoading) { return <div>Loading...</div> }
return (

7
app/routes/app/components/App.js

@ -38,13 +38,8 @@ class App extends Component {
children
} = this.props
console.log('here with currentTicker: ', currentTicker)
if (lnd.syncing) { return <LndSyncing /> }
if (!currentTicker) {
console.log('yooo!')
return <LoadingBolt />
}
if (!currentTicker) { return <LoadingBolt /> }
return (
<div>

3
app/routes/app/containers/AppContainer.js

@ -1,3 +1,4 @@
import { withRouter } from 'react-router'
import { connect } from 'react-redux'
import { fetchTicker, setCurrency, tickerSelectors } from 'reducers/ticker'
import { fetchBalance } from 'reducers/balance'
@ -177,4 +178,4 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
}
}
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(App)
export default withRouter(connect(mapStateToProps, mapDispatchToProps, mergeProps)(App))

15
app/store/configureStore.prod.js

@ -10,19 +10,18 @@ const enhancers = []
middleware.push(thunk)
const history = createBrowserHistory()
const history = createBrowserHistory({ basename: window.location.pathname })
const router = routerMiddleware(history)
middleware.push(router)
console.log('middleware: ', middleware)
enhancers.push(applyMiddleware(...middleware, ipc))
console.log('ENHANCERS: ', enhancers)
middleware.push(ipc)
enhancers.push(applyMiddleware(...middleware))
const enhancer = compose(...enhancers)
// const enhancer = applyMiddleware(thunk, router);
function configureStore(initialState) {
return createStore(rootReducer, initialState, enhancer);
return createStore(rootReducer, initialState, enhancer)
}
export default { configureStore, history };
export default { configureStore, history }

Loading…
Cancel
Save