1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-08 21:42:24 +03:00

remove redundant Promise.all

This commit is contained in:
Michael Telatynski
2021-07-13 17:05:57 +01:00
parent bbd785b158
commit 59a1df71c8

View File

@@ -140,14 +140,9 @@ async function createThumbnail(
} }
const imageData = context.getImageData(0, 0, targetWidth, targetHeight); const imageData = context.getImageData(0, 0, targetWidth, targetHeight);
// thumbnailPromise and blurhash promise are being awaited concurrently
const [ const blurhash = await BlurhashEncoder.instance.getBlurhash(imageData);
thumbnail, const thumbnail = await thumbnailPromise;
blurhash,
] = await Promise.all([
thumbnailPromise,
BlurhashEncoder.instance.getBlurhash(imageData),
]);
return { return {
info: { info: {