Skip to content

Commit 7f87389

Browse files
authored
Merge pull request #1953 from plotly/quieter-reloader
fix unrelenting alert when hot reload fails
2 parents 97470a0 + 54f3ab3 commit 7f87389

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## [Unreleased]
6+
7+
### Fixed
8+
- [#1953](https://github.com/plotly/dash/pull/1953) Fix bug [#1783](https://github.com/plotly/dash/issues/1783) in which a failed hot reloader blocks the UI with alerts.
9+
510
## [2.2.0] - 2022-02-18
611

712
### Added

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)