diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-21 15:33:37 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:16 +0200 |
| commit | 912e1b96bfa7d6c022d854fa744f719b49ca98d0 (patch) | |
| tree | 49cdaf109aa08b0149c34174ce0f00c7056221ea /frontend/src/containers/modals/NewTopologyModal.js | |
| parent | 791b5d1e443f97adc756264878c3aae41ca0f748 (diff) | |
Add first plotting attempts for portfolios
Diffstat (limited to 'frontend/src/containers/modals/NewTopologyModal.js')
| -rw-r--r-- | frontend/src/containers/modals/NewTopologyModal.js | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/frontend/src/containers/modals/NewTopologyModal.js b/frontend/src/containers/modals/NewTopologyModal.js index 282f0db9..99c42367 100644 --- a/frontend/src/containers/modals/NewTopologyModal.js +++ b/frontend/src/containers/modals/NewTopologyModal.js @@ -3,11 +3,11 @@ import NewTopologyModalComponent from '../../components/modals/custom-components import { closeNewTopologyModal } from '../../actions/modals/topology' import { addTopology } from '../../actions/topologies' -const mapStateToProps = state => { - let topologies = state.objects.project[state.currentProjectId] ? state.objects.project[state.currentProjectId].topologyIds.map(t => ( - state.objects.topology[t] - )) : [] - if (topologies.filter(t => !t).length > 0) { +const mapStateToProps = (state) => { + let topologies = state.objects.project[state.currentProjectId] + ? state.objects.project[state.currentProjectId].topologyIds.map((t) => state.objects.topology[t]) + : [] + if (topologies.filter((t) => !t).length > 0) { topologies = [] } @@ -17,22 +17,18 @@ const mapStateToProps = state => { } } -const mapDispatchToProps = dispatch => { +const mapDispatchToProps = (dispatch) => { return { onCreateTopology: (name) => { if (name) { - dispatch( - addTopology({ name, rooms: [] }), - ) + dispatch(addTopology({ name, rooms: [] })) } dispatch(closeNewTopologyModal()) }, onDuplicateTopology: (name) => { if (name) { // TODO different handling here - dispatch( - addTopology({ name, rooms: [] }), - ) + dispatch(addTopology({ name, rooms: [] })) } dispatch(closeNewTopologyModal()) }, @@ -42,8 +38,6 @@ const mapDispatchToProps = dispatch => { } } -const NewTopologyModal = connect(mapStateToProps, mapDispatchToProps)( - NewTopologyModalComponent, -) +const NewTopologyModal = connect(mapStateToProps, mapDispatchToProps)(NewTopologyModalComponent) export default NewTopologyModal |
