Skip to content

Commit

Permalink
Fix issue on error message hanging after even it solved. (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoda authored Sep 14, 2016
1 parent c8a1104 commit 03994fa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion dist/client/preview/config_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var _ = require('./');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* globals location */

var ConfigApi = function () {
function ConfigApi(_ref) {
var channel = _ref.channel;
Expand Down Expand Up @@ -63,7 +65,16 @@ var ConfigApi = function () {
try {
_this._renderMain(loaders);
} catch (error) {
_this._renderError(error);
if (module.hot.status() === 'apply') {
// We got this issue, after webpack fixed it and applying it.
// Therefore error message is displayed forever even it's being fixed.
// So, we'll detect it reload the page.
location.reload();
} else {
// If we are accessing the site, but the error is not fixed yet.
// There we can render the error.
_this._renderError(error);
}
}
};

Expand Down
13 changes: 12 additions & 1 deletion src/client/preview/config_api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* globals location */

import {
setInitialStory,
setError,
Expand Down Expand Up @@ -38,7 +40,16 @@ export default class ConfigApi {
try {
this._renderMain(loaders);
} catch (error) {
this._renderError(error);
if (module.hot.status() === 'apply') {
// We got this issue, after webpack fixed it and applying it.
// Therefore error message is displayed forever even it's being fixed.
// So, we'll detect it reload the page.
location.reload();
} else {
// If we are accessing the site, but the error is not fixed yet.
// There we can render the error.
this._renderError(error);
}
}
};

Expand Down

0 comments on commit 03994fa

Please sign in to comment.