Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit 1a8fd9c

Browse files
committed
Remove reloading state.
1 parent 71a42e2 commit 1a8fd9c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Diff for: src/actions/api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ export function getReloadHash() {
113113
'GET',
114114
'reloadRequest'
115115
)
116-
}
116+
}

Diff for: src/components/core/Reloader.react.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class Reloader extends React.Component {
1111
this.state = {
1212
hash: null,
1313
interval,
14-
reloading: false,
1514
disabled: false
1615
}
1716
} else {
@@ -29,14 +28,14 @@ class Reloader extends React.Component {
2928
this.setState({hash: reloadHash.content.reloadHash});
3029
return;
3130
}
32-
if (reloadHash.content.reloadHash !== this.state.hash && !this.state.reloading ) {
31+
if (reloadHash.content.reloadHash !== this.state.hash) {
3332
// eslint-disable-next-line no-undef
3433
window.clearInterval(this._intervalId);
3534
if (reloadHash.content.hard) {
3635
// Assets file have changed, need to reload them.
3736
// eslint-disable-next-line no-undef
3837
window.top.location.reload();
39-
} else if (!this.state.reloading) {
38+
} else {
4039
// Py file has changed, just rebuild the reducers.
4140
dispatch({'type': 'RELOAD'});
4241
}
@@ -49,9 +48,7 @@ class Reloader extends React.Component {
4948
const { disabled, interval } = this.state;
5049
if (!disabled && !this._intervalId) {
5150
this._intervalId = setInterval(() => {
52-
if (!this.state.reloading) {
53-
dispatch(getReloadHash());
54-
}
51+
dispatch(getReloadHash());
5552
}, interval);
5653
}
5754
}

0 commit comments

Comments
 (0)