fixed background color in hero arent being properly used if game is custom

This commit is contained in:
Moyasee
2025-09-19 20:04:09 +03:00
parent 9ce1c40b21
commit bf9e3de0b5
2 changed files with 11 additions and 2 deletions

View File

@@ -68,8 +68,17 @@ export function GameDetailsContent() {
const [showEditGameModal, setShowEditGameModal] = useState(false);
const handleHeroLoad = async () => {
// Use the same logic as heroImage to get the correct URL for both custom and non-custom games
const isCustomGame = game?.shop === "custom";
const heroImageUrl = isCustomGame
? game?.libraryHeroImageUrl || game?.iconUrl || ""
: getImageWithCustomPriority(
game?.customHeroImageUrl,
shopDetails?.assets?.libraryHeroImageUrl
);
const output = await average(
shopDetails?.assets?.libraryHeroImageUrl ?? "",
heroImageUrl,
{
amount: 1,
format: "hex",

View File

@@ -92,7 +92,7 @@ export function GameOptionsModal({
await removeGameFromLibrary(game.shop, game.objectId);
updateGame();
onClose();
// Redirect to home page if it's a custom game
if (game.shop === "custom" && onNavigateHome) {
onNavigateHome();