Update src/client/lazy-app/util/index.ts

Co-authored-by: Jake Archibald <jaffathecake@gmail.com>
This commit is contained in:
Surma
2021-05-24 16:26:20 +01:00
committed by GitHub
parent cbfa503fcb
commit 58661078e2

View File

@@ -244,9 +244,9 @@ export async function builtinDecode(
): Promise<ImageData> {
// If WebCodecs are supported, use that.
if (await WebCodecs.isTypeSupported(mimeType)) {
if (signal.aborted) return Promise.reject('Aborted');
assertSignal(signal);
try {
return await WebCodecs.decode(blob, mimeType);
return await abortable(signal, WebCodecs.decode(blob, mimeType));
} catch (e) {}
}
assertSignal(signal);