From b7b8c516bd85bb11c1f4ece59329efaad0ac6288 Mon Sep 17 00:00:00 2001 From: gravel Date: Tue, 20 Aug 2024 17:28:30 +0000 Subject: [PATCH] fix: preload room qr codes --- output/main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/output/main.js b/output/main.js index 93b8d48..353df24 100644 --- a/output/main.js +++ b/output/main.js @@ -435,18 +435,21 @@ function preloadImages() { ); const icons = rows.map( 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) { const image = new Image(); image.src = communityQRCodeURL(identifier); preloadedImages.push(image); } - for (const icon of icons) { - if (!icon) { + for (const url of [...icons, ...qrCodes]) { + if (!url) { continue; } const image = new Image(); - image.src = icon; + image.src = url; preloadedImagesNew.push(image); } preloadedImages = preloadedImagesNew;