Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispose error overlay when linting errors have been corrected #856

Merged
merged 3 commits into from
Oct 11, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/react-dev-utils/webpackHotDevClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ function showErrorOverlay(message) {
});
}

function destoryOverlay() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor thing, but you probably meant "destroy" rather than "destory", right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. pardon my spelling error ;-)

if(!overlayDiv) {
//linting from previous linting was successful
return;
}

document.body.removeChild(overlayIframe);
overlayDiv = null;
overlayIframe = null;
lastOnOverlayDivReady = null;
}

// Connect to WebpackDevServer via a socket.
var connection = new SockJS(url.format({
protocol: window.location.protocol,
Expand Down Expand Up @@ -156,6 +168,7 @@ function clearOutdatedErrors() {
// Successful compilation.
function handleSuccess() {
clearOutdatedErrors();
destoryOverlay();

var isHotUpdate = !isFirstCompilation;
isFirstCompilation = false;
Expand All @@ -170,6 +183,7 @@ function handleSuccess() {
// Compilation with warnings (e.g. ESLint).
function handleWarnings(warnings) {
clearOutdatedErrors();
destoryOverlay();

var isHotUpdate = !isFirstCompilation;
isFirstCompilation = false;
Expand Down