Skip to content

Commit 28ee9cb

Browse files
committed
fix #1783 unrelenting alert when hot reload fails
1 parent 97470a0 commit 28ee9cb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dash/dash-renderer/src/components/core/Reloader.react.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,16 @@ class Reloader extends React.Component {
154154
// Backend code changed - can do a soft reload in place
155155
dispatch({type: 'RELOAD'});
156156
}
157-
} else if (reloadRequest.status === 500) {
157+
} else if (
158+
this.state.intervalId !== null &&
159+
reloadRequest.status === 500
160+
) {
158161
if (this._retry > this.state.max_retry) {
159162
this.clearInterval();
160163
// Integrate with dev tools ui?!
161164
window.alert(
162-
`
163-
Reloader failed after ${this._retry} times.
164-
Please check your application for errors.
165-
`
165+
`Hot reloading is disabled after failing ${this._retry} times. ` +
166+
'Please check your application for errors, then refresh the page.'
166167
);
167168
}
168169
this._retry++;

0 commit comments

Comments
 (0)