wip
This commit is contained in:
@@ -6,9 +6,12 @@ onmessage = (event) => {
|
||||
if ('canvas' in event.data) {
|
||||
canvas = event.data.canvas;
|
||||
}
|
||||
if (!(canvas && 'hash' in event.data && typeof event.data.hash === 'string')) {
|
||||
console.error('Cannot draw blurhash without canvas and hash', canvas, event.data);
|
||||
throw new Error('Cannot draw blurhash without canvas and hash');
|
||||
if (!canvas) {
|
||||
console.error('Cannot draw blurhash without canvas', canvas, event.data);
|
||||
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 height = event.data.height ?? 64;
|
||||
|
Reference in New Issue
Block a user