diff --git a/app/containers/Root.js b/app/containers/Root.js
index 7e38493a..902864ab 100644
--- a/app/containers/Root.js
+++ b/app/containers/Root.js
@@ -1,20 +1,55 @@
// @flow
import React from 'react'
-import { Provider } from 'react-redux'
+import { Provider, connect } from 'react-redux'
import { ConnectedRouter } from 'react-router-redux'
+import { fetchBlockHeight, lndSelectors } from 'reducers/lnd'
+import LndSyncing from 'components/LndSyncing'
import Routes from '../routes'
+const mapDispatchToProps = {
+ fetchBlockHeight
+}
+
+const mapStateToProps = state => ({
+ lnd: state.lnd,
+
+ syncPercentage: lndSelectors.syncPercentage(state)
+})
+
type RootType = {
store: {},
history: {}
};
-export default function Root({ store, history }: RootType) {
- return (
-
-
-
-
-
- )
-}
+class Root extends React.Component {
+ render() {
+ const {
+ store,
+ history,
+ lnd,
+ fetchBlockHeight,
+ syncPercentage
+ } = this.props
+
+ if (lnd.syncing) {
+ return (
+
+ )
+ }
+
+ return (
+
+
+
+
+
+ )
+ }
+}
+
+
+export default connect(mapStateToProps, mapDispatchToProps)(Root)
\ No newline at end of file
diff --git a/app/reducers/address.js b/app/reducers/address.js
index 7ecb63f5..6bc40de4 100644
--- a/app/reducers/address.js
+++ b/app/reducers/address.js
@@ -24,11 +24,15 @@ export function getAddress() {
// Send IPC event for getinfo
export const newAddress = type => async (dispatch) => {
dispatch(getAddress())
+ console.log('getting new address type: ', addressTypes[type])
ipcRenderer.send('lnd', { msg: 'newaddress', data: { type: addressTypes[type] } })
}
// Receive IPC event for info
-export const receiveAddress = (event, address) => dispatch => dispatch({ type: RECEIVE_ADDRESS, address })
+export const receiveAddress = (event, address) => dispatch => {
+ console.log('address: ', address)
+ dispatch({ type: RECEIVE_ADDRESS, address })
+}
// ------------------------------------
// Action Handlers
diff --git a/app/routes.js b/app/routes.js
index d700389d..52bcaf6a 100644
--- a/app/routes.js
+++ b/app/routes.js
@@ -14,4 +14,4 @@ export default () => (
-);
+)
diff --git a/app/routes/app/components/App.js b/app/routes/app/components/App.js
index c2677bef..df379315 100644
--- a/app/routes/app/components/App.js
+++ b/app/routes/app/components/App.js
@@ -13,12 +13,10 @@ class App extends Component {
componentWillMount() {
const { fetchTicker, fetchBalance, fetchInfo, newAddress, lnd: { syncing } } = this.props
- if (!syncing) {
- fetchTicker()
- fetchBalance()
- fetchInfo()
- newAddress('p2pkh')
- }
+ fetchTicker()
+ fetchBalance()
+ fetchInfo()
+ newAddress('p2pkh')
}
render() {
@@ -47,16 +45,6 @@ class App extends Component {
children
} = this.props
- if (lnd.syncing) {
- return (
-
- )
- }
-
if (!currentTicker || balance.balanceLoading) { return
}
return (
diff --git a/resources/bin/darwin/lnd b/resources/bin/darwin/lnd
deleted file mode 100755
index c62fea6b..00000000
Binary files a/resources/bin/darwin/lnd and /dev/null differ