mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
Update image-media.ts (#9276)
This commit is contained in:
parent
4623d84dd0
commit
eace4d6894
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ export async function createThumbnail(
|
|||
context.drawImage(element, 0, 0, targetWidth, targetHeight);
|
||||
|
||||
let thumbnailPromise: Promise<Blob>;
|
||||
if (canvas instanceof window.OffscreenCanvas) {
|
||||
if (window.OffscreenCanvas && canvas instanceof window.OffscreenCanvas) {
|
||||
thumbnailPromise = canvas.convertToBlob({ type: mimeType });
|
||||
} else {
|
||||
thumbnailPromise = new Promise<Blob>(resolve => (canvas as HTMLCanvasElement).toBlob(resolve, mimeType));
|
||||
|
|
Loading…
Reference in a new issue