From 911a72f7ad41fe898e69a34634126b2ba29e3e46 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 14 Nov 2024 20:23:58 +0200 Subject: [PATCH] Add dlc capsule image fallback --- scripts/community/achievements.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/community/achievements.js b/scripts/community/achievements.js index ac87c0a5..bd0a00ee 100644 --- a/scripts/community/achievements.js +++ b/scripts/community/achievements.js @@ -921,6 +921,18 @@ function InitAchievements( items, isPersonal ) } else { + summaryGameLogoImg.addEventListener( 'error', () => + { + summaryGameLogoImg.addEventListener( 'error', () => + { + summaryGameLogoImg.src = gameLogoElement.querySelector( 'img' ).src; + }, { once: true } ); + + // Fallback to the header for now because they are not hashed + summaryGameLogoImg.src = `${applicationConfig.STORE_ICON_BASE_URL}${dlcAppId}/header.jpg`; + }, { once: true } ); + + // TODO: Need to query the api to get correct hashed url for the capsule summaryGameLogoImg.src = `${applicationConfig.STORE_ICON_BASE_URL}${dlcAppId}/capsule_184x69.jpg`; }