Commit 6fa61d07 authored by Sonja Happ's avatar Sonja Happ

initialize temporal widget as empty before it is overwritten with props widget

parent d954941d
...@@ -34,12 +34,7 @@ class EditWidgetDialog extends React.Component { ...@@ -34,12 +34,7 @@ class EditWidgetDialog extends React.Component {
super(props); super(props);
this.state = { this.state = {
temporal: { temporal: {},
name: '',
simulationModel: '',
signal: 0
}
}; };
} }
...@@ -73,7 +68,7 @@ class EditWidgetDialog extends React.Component { ...@@ -73,7 +68,7 @@ class EditWidgetDialog extends React.Component {
} }
handleChange(e) { handleChange(e) {
// TODO: check what we really need in this function. Can we reduce its complexity?
if (e.constructor === Array) { if (e.constructor === Array) {
// Every property in the array will be updated // Every property in the array will be updated
let changes = e.reduce( (changesObject, event) => { let changes = e.reduce( (changesObject, event) => {
...@@ -123,11 +118,8 @@ class EditWidgetDialog extends React.Component { ...@@ -123,11 +118,8 @@ class EditWidgetDialog extends React.Component {
finalChange[e.target.id] = e.target.value; finalChange[e.target.id] = e.target.value;
this.setState({ temporal: finalChange}); this.setState({ temporal: finalChange});
} }
} }
} }
resetState() { resetState() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment