Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Fix #61
Browse files Browse the repository at this point in the history
  • Loading branch information
lelinhtinh committed Mar 25, 2021
1 parent bfe7a25 commit db09f8b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@
},
workerFormat,
workerDecode,
workerError = (err) => {
stopEffect();
view.innerHTML = `<span class="hljs-variable">${err.message}</span>`;
},
format = debounce(function () {
if (temp === '') return;

Expand All @@ -194,9 +198,7 @@
source: temp,
options: options,
});
workerFormat.addEventListener('error', function (err) {
console.error('Format Error!', err);
});
workerFormat.addEventListener('error', workerError);
}, 250),
detect = function (source) {
var type = '';
Expand Down Expand Up @@ -258,9 +260,7 @@

format();
});
workerDecode.addEventListener('error', function (err) {
console.error('Decode Error!', err);
});
workerDecode.addEventListener('error', workerError);
}

startEffect();
Expand Down Expand Up @@ -456,8 +456,8 @@
fragment.appendChild(txt);
renderRemove.appendChild(fragment);
})
.catch(function (error) {
renderRemove.textContent = error.message;
.catch(function (err) {
renderRemove.innerHTML = `<span class="hljs-variable">${err.message}</span>`;
});
};

Expand Down

0 comments on commit db09f8b

Please sign in to comment.