From 1185a43069350e5c4c9bf9b58ed9b3b684c284c1 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Wed, 28 Nov 2018 19:34:59 +0100 Subject: [PATCH] fix(wallet): load suggested nodes on Root mount Load the suggested nodes list as early as possible, when the Root container first mounts. Ensure that we display nothing when node list was not loaded. Fix #943 --- app/components/App/App.js | 19 ++++++------------- app/components/Contacts/Network/Network.js | 4 +++- app/containers/Root.js | 5 +++++ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/components/App/App.js b/app/components/App/App.js index f24089d3..1270a238 100644 --- a/app/components/App/App.js +++ b/app/components/App/App.js @@ -26,22 +26,15 @@ class App extends React.Component { receiveModalProps: PropTypes.object, channelFormProps: PropTypes.object, fetchInfo: PropTypes.func.isRequired, - fetchDescribeNetwork: PropTypes.func.isRequired, - fetchSuggestedNodes: PropTypes.func.isRequired + fetchDescribeNetwork: PropTypes.func.isRequired } componentDidMount() { - const { currentTicker, fetchInfo, fetchSuggestedNodes, fetchDescribeNetwork } = this.props - - // If we don't yet have any ticker information then it must be our first time mounting this component. - if (!currentTicker) { - // fetch node info. - fetchInfo() - // fetch suggested nodes list from zap.jackmallers.com/suggested-peers. - fetchSuggestedNodes() - // fetch LN network from nodes POV. - fetchDescribeNetwork() - } + const { fetchInfo, fetchDescribeNetwork } = this.props + // fetch node info. + fetchInfo() + // fetch LN network from nodes POV. + fetchDescribeNetwork() } render() { diff --git a/app/components/Contacts/Network/Network.js b/app/components/Contacts/Network/Network.js index edf08c50..db21d185 100644 --- a/app/components/Contacts/Network/Network.js +++ b/app/components/Contacts/Network/Network.js @@ -369,7 +369,9 @@ class Network extends Component { })} - {(loadingChannelPubkeys.length || pending_open_channels.length || channels.length) && ( + {Boolean( + loadingChannelPubkeys.length || pending_open_channels.length || channels.length + ) && (