aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/dialogs/Loop/OpenLoopModal.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui-react/src/components/dialogs/Loop/OpenLoopModal.js')
-rw-r--r--ui-react/src/components/dialogs/Loop/OpenLoopModal.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui-react/src/components/dialogs/Loop/OpenLoopModal.js b/ui-react/src/components/dialogs/Loop/OpenLoopModal.js
index fbfc727e..4e8d9782 100644
--- a/ui-react/src/components/dialogs/Loop/OpenLoopModal.js
+++ b/ui-react/src/components/dialogs/Loop/OpenLoopModal.js
@@ -68,15 +68,16 @@ export default class OpenLoopModal extends React.Component {
getLoopNames() {
LoopService.getLoopNames().then(loopNames => {
- const loopOptions = loopNames.map((loopName) => { return { label: loopName, value: loopName } });
- this.setState({ loopNames: loopOptions })
+ if (Object.entries(loopNames).length !== 0) {
+ const loopOptions = loopNames.filter(loopName => loopName!=='undefined').map((loopName) => { return { label: loopName, value: loopName } });
+ this.setState({ loopNames: loopOptions })
+ }
});
}
handleOpen() {
console.info("Loop " + this.state.chosenLoopName + " is chosen");
- this.setState({ show: false });
- this.props.history.push('/');
+ this.handleClose();
this.props.loadLoopFunction(this.state.chosenLoopName);
}