diff options
author | Emiliano Ciavatta | 2020-10-16 13:09:05 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-10-16 13:09:05 +0000 |
commit | 5534413b3a3e6e783310be8147ac8340d3098a7e (patch) | |
tree | 395428b5f156855764297542ae0e395b1d157aca /frontend/src/components/panels/ConnectionsPane.js | |
parent | d4bac2d6741f7a291522c29c9ecc87c3e32e21d4 (diff) |
Fix tests. General refactor
Diffstat (limited to 'frontend/src/components/panels/ConnectionsPane.js')
-rw-r--r-- | frontend/src/components/panels/ConnectionsPane.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/frontend/src/components/panels/ConnectionsPane.js b/frontend/src/components/panels/ConnectionsPane.js index 23c6114..9418fad 100644 --- a/frontend/src/components/panels/ConnectionsPane.js +++ b/frontend/src/components/panels/ConnectionsPane.js @@ -178,7 +178,7 @@ class ConnectionsPane extends Component { let firstConnection = this.state.firstConnection; let lastConnection = this.state.lastConnection; - if (additionalParams !== undefined && additionalParams.from !== undefined && additionalParams.to === undefined) { + if (additionalParams && additionalParams.from && !additionalParams.to) { if (res.length > 0) { if (!isInitial) { res = res.slice(1); @@ -194,7 +194,7 @@ class ConnectionsPane extends Component { firstConnection = connections[0]; } } - } else if (additionalParams !== undefined && additionalParams.to !== undefined && additionalParams.from === undefined) { + } else if (additionalParams && additionalParams.to && !additionalParams.from) { if (res.length > 0) { connections = res.slice(0, res.length - 1).concat(this.state.connections); firstConnection = connections[0]; @@ -215,12 +215,7 @@ class ConnectionsPane extends Component { } } - this.setState({ - loading: false, - connections: connections, - firstConnection: firstConnection, - lastConnection: lastConnection - }); + this.setState({loading: false, connections, firstConnection, lastConnection}); if (firstConnection != null && lastConnection != null) { dispatcher.dispatch("connection_updates", { |