From 52865c97f820b883977179930ce4961abdb39c12 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 3 Jul 2020 11:46:29 +0200 Subject: Fix integer IDs and topology deletion --- frontend/src/components/modals/Modal.js | 6 ++++-- .../modals/custom-components/ChangeTopologyModalComponent.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'frontend/src/components/modals') diff --git a/frontend/src/components/modals/Modal.js b/frontend/src/components/modals/Modal.js index ec6080f2..dd8cea8e 100644 --- a/frontend/src/components/modals/Modal.js +++ b/frontend/src/components/modals/Modal.js @@ -50,8 +50,10 @@ class Modal extends React.Component { } componentDidUpdate() { - this.visible = this.props.show - this.openOrCloseModal() + if (this.visible !== this.props.show) { + this.visible = this.props.show + this.openOrCloseModal() + } } onSubmit() { diff --git a/frontend/src/components/modals/custom-components/ChangeTopologyModalComponent.js b/frontend/src/components/modals/custom-components/ChangeTopologyModalComponent.js index f1645dcf..c7c81706 100644 --- a/frontend/src/components/modals/custom-components/ChangeTopologyModalComponent.js +++ b/frontend/src/components/modals/custom-components/ChangeTopologyModalComponent.js @@ -7,7 +7,7 @@ class ChangeTopologyModalComponent extends React.Component { static propTypes = { show: PropTypes.bool.isRequired, topologies: PropTypes.arrayOf(Shapes.Topology), - currentTopologyId: PropTypes.number, + currentTopologyId: PropTypes.string, onChooseTopology: PropTypes.func.isRequired, onCreateTopology: PropTypes.func.isRequired, onDuplicateTopology: PropTypes.func.isRequired, -- cgit v1.2.3