fix: preload room qr codes

dev
gravel 10 months ago
parent 1ad99d30a8
commit b7b8c516bd
No known key found for this signature in database
GPG Key ID: CA95FFF4E0123903

@ -435,18 +435,21 @@ function preloadImages() {
); );
const icons = rows.map( const icons = rows.map(
rowElement => rowElement.getAttribute(ATTRIBUTES.ROW.ROOM_ICON)?.split(":")?.[0] rowElement => rowElement.getAttribute(ATTRIBUTES.ROW.ROOM_ICON)?.split(":")?.[0]
) );
const qrCodes = rows.map(
rowElement => communityQRCodeURL(rowElement.getAttribute(ATTRIBUTES.ROW.IDENTIFIER))
);
for (const identifier of identifiers) { for (const identifier of identifiers) {
const image = new Image(); const image = new Image();
image.src = communityQRCodeURL(identifier); image.src = communityQRCodeURL(identifier);
preloadedImages.push(image); preloadedImages.push(image);
} }
for (const icon of icons) { for (const url of [...icons, ...qrCodes]) {
if (!icon) { if (!url) {
continue; continue;
} }
const image = new Image(); const image = new Image();
image.src = icon; image.src = url;
preloadedImagesNew.push(image); preloadedImagesNew.push(image);
} }
preloadedImages = preloadedImagesNew; preloadedImages = preloadedImagesNew;

Loading…
Cancel
Save