Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Mar 3, 2019
1 parent f155943 commit b54120a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/parcel-bundler/src/builtins/hmr-runtime.js
Expand Up @@ -29,7 +29,7 @@ if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
var ws = new WebSocket(protocol + '://' + hostname + ':' + process.env.HMR_PORT + '/');
ws.onmessage = function(event) {
updatedAssets = {};

var data = JSON.parse(event.data);

if (data.type === 'update') {
Expand All @@ -42,7 +42,10 @@ if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
var handled = false;
data.assets.forEach(function (asset) {
if (!asset.isNew) {
handled = handled || hmrAccept(global.parcelRequire, asset.id);
var didAccept = hmrAccept(global.parcelRequire, asset.id);
if (didAccept) {
handled = true;
}
}
});

Expand Down

0 comments on commit b54120a

Please sign in to comment.