fix: original path to image not showing in modal after updating game asset

This commit is contained in:
Moyasee
2025-09-30 02:09:19 +03:00
parent f0cb2f9579
commit 959bed746b
6 changed files with 81 additions and 13 deletions

View File

@@ -11,7 +11,10 @@ const updateCustomGame = async (
title: string,
iconUrl?: string,
logoImageUrl?: string,
libraryHeroImageUrl?: string
libraryHeroImageUrl?: string,
originalIconPath?: string,
originalLogoPath?: string,
originalHeroPath?: string
) => {
const gameKey = levelKeys.game(shop, objectId);
@@ -40,6 +43,9 @@ const updateCustomGame = async (
iconUrl: iconUrl || null,
logoImageUrl: logoImageUrl || null,
libraryHeroImageUrl: libraryHeroImageUrl || null,
originalIconPath: originalIconPath || existingGame.originalIconPath || null,
originalLogoPath: originalLogoPath || existingGame.originalLogoPath || null,
originalHeroPath: originalHeroPath || existingGame.originalHeroPath || null,
};
await gamesSublevel.put(gameKey, updatedGame);

View File

@@ -38,7 +38,10 @@ const updateGameData = async (
title: string,
customIconUrl?: string | null,
customLogoImageUrl?: string | null,
customHeroImageUrl?: string | null
customHeroImageUrl?: string | null,
customOriginalIconPath?: string | null,
customOriginalLogoPath?: string | null,
customOriginalHeroPath?: string | null
): Promise<Game> => {
const updatedGame = {
...existingGame,
@@ -46,6 +49,9 @@ const updateGameData = async (
...(customIconUrl !== undefined && { customIconUrl }),
...(customLogoImageUrl !== undefined && { customLogoImageUrl }),
...(customHeroImageUrl !== undefined && { customHeroImageUrl }),
...(customOriginalIconPath !== undefined && { customOriginalIconPath }),
...(customOriginalLogoPath !== undefined && { customOriginalLogoPath }),
...(customOriginalHeroPath !== undefined && { customOriginalHeroPath }),
};
await gamesSublevel.put(gameKey, updatedGame);
@@ -87,7 +93,10 @@ const updateGameCustomAssets = async (
title: string,
customIconUrl?: string | null,
customLogoImageUrl?: string | null,
customHeroImageUrl?: string | null
customHeroImageUrl?: string | null,
customOriginalIconPath?: string | null,
customOriginalLogoPath?: string | null,
customOriginalHeroPath?: string | null
) => {
const gameKey = levelKeys.game(shop, objectId);
@@ -109,7 +118,10 @@ const updateGameCustomAssets = async (
title,
customIconUrl,
customLogoImageUrl,
customHeroImageUrl
customHeroImageUrl,
customOriginalIconPath,
customOriginalLogoPath,
customOriginalHeroPath
);
await updateShopAssets(gameKey, title);