From ca2369961396c339106fb28f9405f62f844e437b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 31 Jul 2019 01:25:31 +0200 Subject: [PATCH] pond: Use mountWindow in NodeList --- lotuspond/front/src/NodeList.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lotuspond/front/src/NodeList.js b/lotuspond/front/src/NodeList.js index 75bddc342..3da7a84e7 100644 --- a/lotuspond/front/src/NodeList.js +++ b/lotuspond/front/src/NodeList.js @@ -32,6 +32,13 @@ class NodeList extends React.Component { async spawnNode() { const node = await this.props.client.call('Pond.Spawn') console.log(node) + this.props.mountWindow((onClose) => + this.setState(prev => ({nodes: {...prev.nodes, [node.ID]: {...node, conn: conn, peerid: id}}}))} + mountWindow={this.props.mountWindow}/>) + this.setState(state => ({nodes: {...state.nodes, [node.ID]: node}})) } @@ -62,17 +69,6 @@ class NodeList extends React.Component {
- { - Object.keys(this.state.nodes).map(n => { - const node = this.state.nodes[n] - - return ( this.setState(prev => ({nodes: {...prev.nodes, [n]: {...node, conn: conn, peerid: id}}}))} - mountWindow={this.props.mountWindow}/>) - }) - } {connMgr} {consensus}