in src/application/ui/src/components/ProductImage.js [56:83]
set(key, value) {
// If the key already exists, just update its value and mark as recently used
if (this.cache.has(key)) {
this.cache.set(key, value);
this.markAsRecentlyUsed(key);
// If it's an error image, add to error set
if (value === ERROR_IMAGE) {
this.errorImages.add(key);
this.loadedImages.delete(key); // Remove from loaded if it was there
}
return;
}
// If we're at capacity, remove the least recently used item
if (this.accessOrder.length >= this.maxSize) {
this.evictLeastUsedItem();
}
// Add the new item
this.cache.set(key, value);
this.accessOrder.push(key);
// If it's an error image, add to error set
if (value === ERROR_IMAGE) {
this.errorImages.add(key);
}
}