Ignoring errors when building blob URL for PNG

If it fails, then the link won't be displayed
This commit is contained in:
Jeff Avallone 2018-02-10 14:04:55 -05:00
parent f78e388e20
commit 9cbd923c1f
1 changed files with 6 additions and 3 deletions

View File

@ -181,9 +181,12 @@ export default class Regexper {
try {
context.drawImage(loader, 0, 0, loader.width, loader.height);
canvas.toBlob(blob => {
window.pngBlob = blob;
this.downloadPng.href = URL.createObjectURL(window.pngBlob);
this.links.className = this.links.className.replace(/\bhide-download-png\b/, '');
try {
window.pngBlob = blob;
this.downloadPng.href = URL.createObjectURL(window.pngBlob);
this.links.className = this.links.className.replace(/\bhide-download-png\b/, '');
}
catch(e) {}
}, 'image/png');
}
catch(e) {}