wip
This commit is contained in:
parent
b7827f1cae
commit
6b8e60a7d4
|
@ -6,9 +6,12 @@ onmessage = (event) => {
|
||||||
if ('canvas' in event.data) {
|
if ('canvas' in event.data) {
|
||||||
canvas = event.data.canvas;
|
canvas = event.data.canvas;
|
||||||
}
|
}
|
||||||
if (!(canvas && 'hash' in event.data && typeof event.data.hash === 'string')) {
|
if (!canvas) {
|
||||||
console.error('Cannot draw blurhash without canvas and hash', canvas, event.data);
|
console.error('Cannot draw blurhash without canvas', canvas, event.data);
|
||||||
throw new Error('Cannot draw blurhash without canvas and hash');
|
throw new Error('Cannot draw blurhash without canvas');
|
||||||
|
}
|
||||||
|
if (!('hash' in event.data && typeof event.data.hash === 'string')) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const width = event.data.width ?? 64;
|
const width = event.data.width ?? 64;
|
||||||
const height = event.data.height ?? 64;
|
const height = event.data.height ?? 64;
|
||||||
|
|
Loading…
Reference in New Issue