diff --git a/app/containers/Root.js b/app/containers/Root.js
index 7e38493a..14bd76a6 100644
--- a/app/containers/Root.js
+++ b/app/containers/Root.js
@@ -1,20 +1,48 @@
// @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 => ({
+ 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, fetchBlockHeight, syncPercentage } = this.props
+ const { lnd } = store.getState()
+
+ if (lnd.syncing) {
+ return (
+
+ )
+ }
+
+ return (
+
+
+
+
+
+ )
+ }
+}
+
+
+export default connect(mapStateToProps, mapDispatchToProps)(Root)
\ No newline at end of file
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 (