summaryrefslogtreecommitdiff
path: root/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-07-22 15:39:11 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:48:20 +0200
commit9e7cb3bd367607b32e102c3a87b68b33c53dec46 (patch)
tree6fb7b15af5ba40b4e9244f506167139e7d2ad7a6 /frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
parent1b09fadbd14ba69a6adff57c87a1a7998e68f06e (diff)
Fix scenario name handling and increase margin
Diffstat (limited to 'frontend/src/components/modals/custom-components/NewScenarioModalComponent.js')
-rw-r--r--frontend/src/components/modals/custom-components/NewScenarioModalComponent.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
index 51116f59..d7d99982 100644
--- a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
+++ b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js
@@ -19,7 +19,11 @@ class NewScenarioModalComponent extends React.Component {
}
componentDidUpdate() {
- this.textInput.value = this.props.currentPortfolioScenarioIds.length === 0 ? 'Base scenario' : ''
+ if (this.props.currentPortfolioScenarioIds.length === 0) {
+ this.textInput.value = 'Base scenario'
+ } else if (this.textInput.value === 'Base scenario') {
+ this.textInput.value = ''
+ }
}
reset() {