Skip to content

Commit

Permalink
Fix dismissed error overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
deftomat committed Jan 27, 2019
1 parent 9a8fc4d commit 321d960
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/react-dev-utils/webpackHotDevClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function handleSuccess() {
tryApplyUpdates(function onHotUpdateSuccess() {
// Only dismiss it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
ErrorOverlay.dismissBuildError();
tryDismissErrorOverlay();
});
}
}
Expand Down Expand Up @@ -147,7 +147,7 @@ function handleWarnings(warnings) {
tryApplyUpdates(function onSuccessfulHotUpdate() {
// Only dismiss it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
ErrorOverlay.dismissBuildError();
tryDismissErrorOverlay();
});
}
}
Expand Down Expand Up @@ -179,6 +179,12 @@ function handleErrors(errors) {
// We will reload on next success instead.
}

function tryDismissErrorOverlay() {
if (!hasCompileErrors) {
ErrorOverlay.dismissBuildError();
}
}

// There is a newer version of the code available.
function handleAvailableHash(hash) {
// Update last known compilation hash.
Expand Down

0 comments on commit 321d960

Please sign in to comment.