FIX: Pass fileName to error handler for media optimization (#14058)

The file name is used to look up the promise to resolve; it
was being passed for the successful path but not for the
error path.
This commit is contained in:
Martin Brennan 2021-08-17 09:33:16 +10:00 committed by GitHub
parent 9b7c17b925
commit 90ab520d06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -139,7 +139,8 @@ onmessage = async function (e) {
console.error(error); console.error(error);
postMessage({ postMessage({
type: "error", type: "error",
file: e.data.file file: e.data.file,
fileName: e.data.fileName
}); });
} }
break; break;
@ -172,4 +173,4 @@ async function loadLibs(settings){
await wasm_bindgen(settings.resize_wasm); await wasm_bindgen(settings.resize_wasm);
self.codecs = {mozjpeg_enc: mozjpeg_enc_module, resize: resize}; self.codecs = {mozjpeg_enc: mozjpeg_enc_module, resize: resize};
} }