Skip to content

Commit e91e768

Browse files
scpa1055cassava
authored andcommitted
ui: Fix fetch interval
1 parent a1c4126 commit e91e768

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ui/src/App.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class App extends Component {
7373
configData: {},
7474
initialHost: "",
7575
host: "",
76-
updateInterval: 500,
76+
updateInterval: 1000,
7777
connected: false,
7878
sideBarOpen: false,
7979
dragNDropActivated: false,
@@ -91,7 +91,7 @@ class App extends Component {
9191
this.jsonVersionChecked = false;
9292
this.fetchCloeApi = 0;
9393
this.bufferInterval = 0;
94-
this.defaultUpdateInterval = 500;
94+
this.defaultUpdateInterval = 1000;
9595
// Definitions for the one-time fetched information.
9696
this.controllers = [];
9797
this.simulators = [];
@@ -523,18 +523,16 @@ class App extends Component {
523523
axios
524524
.get(`http://${this.state.host}`)
525525
.then(() => {
526-
// If connected set new interval.
527-
this.renewFetchInterval(this.defaultUpdateInterval);
528526
if (!this.state.connected) {
529527
this.setState({ connected: true, startupPhase: 2 });
530528
}
531529
})
532530
.catch(() => {
533531
this.setState({ connected: false });
534-
if (this.startupPhase === 2) {
532+
if (this.state.startupPhase === 2) {
535533
this.setState({ startupPhase: 1 });
536534
}
537-
if (this.startupPhase === 3) {
535+
if (this.state.startupPhase === 3) {
538536
this.setState({ startupPhase: 4 });
539537
}
540538
});
@@ -609,7 +607,7 @@ class App extends Component {
609607
startupStepFour = () => {
610608
if (this.state.connected) {
611609
this.setState({ startupPhase: 2 });
612-
this.renewFetchInterval(100);
610+
this.renewFetchInterval(this.defaultUpdateInterval);
613611
}
614612
};
615613

0 commit comments

Comments
 (0)