mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
refresh only if no edit or delete dialog is open
This commit is contained in:
parent
d4c1f3cbcc
commit
3f03dc98e4
1 changed files with 12 additions and 6 deletions
|
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue