From 3f03dc98e4074377379a513e62cb55d6bb4c8d25 Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Wed, 24 Jul 2019 17:03:02 +0200 Subject: [PATCH] refresh only if no edit or delete dialog is open --- src/containers/simulators.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/containers/simulators.js b/src/containers/simulators.js index aae637f..c44567f 100644 --- a/src/containers/simulators.js +++ b/src/containers/simulators.js @@ -96,7 +96,7 @@ class Simulators extends Component { }); // Start timer for periodic refresh - this.timer = window.setInterval(() => this.refresh(), 10000); + this.timer = window.setInterval(() => this.refresh(), 1000); } componentWillUnmount() { @@ -104,11 +104,17 @@ class Simulators extends Component { } refresh() { - AppDispatcher.dispatch({ - type: 'simulators/start-load', - token: this.state.sessionToken, - userid: this.state.sessionUserID - }); + + if (this.state.editModal || this.state.deleteModal){ + // do nothing since a dialog is open at the moment + } + else { + AppDispatcher.dispatch({ + type: 'simulators/start-load', + token: this.state.sessionToken, + userid: this.state.sessionUserID + }); + } }