Refresh image cache to obscure activity

dev
gravel 11 months ago
parent 648820b381
commit 1863429411
Signed by: gravel
GPG Key ID: C0538F3C906B308F

@ -49,7 +49,7 @@ const filteredCommunities = {
/**
* Hanging reference to preloaded images to avoid garbage collection.
*/
const preloadedImages = [];
let preloadedImages = [];
/**
* Create an interactive version of the Community join link.
@ -134,6 +134,9 @@ function onLoad() {
addQRModalHandlers();
addServerIconInteractions();
preloadImages();
setInterval(() => {
preloadImages();
}, 60 * 60E3);
reactToURLParameters();
addInformativeInteractions();
}
@ -320,6 +323,7 @@ function addQRModalHandlers() {
* Prefetches images used in the page to prevent tracking.
*/
function preloadImages() {
const preloadedImagesNew = [];
const rows = dom.tbl_communities_content_rows();
const identifiers = rows.map(
rowElement => rowElement.getAttribute(ATTRIBUTES.ROW.IDENTIFIER)
@ -338,8 +342,9 @@ function preloadImages() {
}
const image = new Image();
image.src = icon;
preloadedImages.push(image);
preloadedImagesNew.push(image);
}
preloadedImages = preloadedImagesNew;
}
/**

Loading…
Cancel
Save