summaryrefslogtreecommitdiff
path: root/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-10-28 00:36:19 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-10-28 11:38:34 +0100
commit7e05dc7a885cf562052461565376e174e6a9c962 (patch)
tree025412c87b233b88d715f082be37e964e2090931 /frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
parent5ec42736f3f17e9f5432063b4cc17e6ad9a75713 (diff)
Migrate to Reactstrap for Modal implementation
Diffstat (limited to 'frontend/src/components/modals/custom-components/NewScenarioModalComponent.js')
-rw-r--r--frontend/src/components/modals/custom-components/NewScenarioModalComponent.js26
1 files changed, 15 insertions, 11 deletions
diff --git a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
index d7d99982..5ba74b0f 100644
--- a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
+++ b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
@@ -19,21 +19,25 @@ class NewScenarioModalComponent extends React.Component {
}
componentDidUpdate() {
- if (this.props.currentPortfolioScenarioIds.length === 0) {
- this.textInput.value = 'Base scenario'
- } else if (this.textInput.value === 'Base scenario') {
- this.textInput.value = ''
+ if (this.textInput) {
+ if (this.props.currentPortfolioScenarioIds.length === 0) {
+ this.textInput.value = 'Base scenario'
+ } else if (this.textInput.value === 'Base scenario') {
+ this.textInput.value = ''
+ }
}
}
reset() {
- this.textInput.value = this.props.currentPortfolioScenarioIds.length === 0 ? 'Base scenario' : ''
- this.traceSelect.selectedIndex = 0
- this.traceLoadInput.value = 1.0
- this.topologySelect.selectedIndex = 0
- this.failuresCheckbox.checked = false
- this.performanceInterferenceCheckbox.checked = false
- this.schedulerSelect.selectedIndex = 0
+ if (this.textInput) {
+ this.textInput.value = this.props.currentPortfolioScenarioIds.length === 0 ? 'Base scenario' : ''
+ this.traceSelect.selectedIndex = 0
+ this.traceLoadInput.value = 1.0
+ this.topologySelect.selectedIndex = 0
+ this.failuresCheckbox.checked = false
+ this.performanceInterferenceCheckbox.checked = false
+ this.schedulerSelect.selectedIndex = 0
+ }
}
onSubmit() {