feat: refactor assets in game details page

This commit is contained in:
Zamitto
2025-05-09 18:22:09 -03:00
parent 171c728616
commit 382a618c3f
8 changed files with 63 additions and 50 deletions

View File

@@ -34,8 +34,8 @@ const getGameShopDetails = async (
gamesShopAssetsSublevel.get(levelKeys.game(shop, objectId)),
]);
const appDetails: Promise<ShopDetailsWithAssets | null> =
getLocalizedSteamAppDetails(objectId, language).then((result) => {
const appDetails = getLocalizedSteamAppDetails(objectId, language).then(
(result) => {
if (result) {
result.name = cachedAssets?.title ?? result.name;
@@ -47,21 +47,22 @@ const getGameShopDetails = async (
return {
...result,
...cachedAssets,
assets: cachedAssets ?? null,
};
}
return null;
});
}
);
if (cachedData) {
return {
...cachedData,
...cachedAssets,
assets: cachedAssets ?? null,
};
}
return Promise.resolve(appDetails);
return appDetails;
}
throw new Error("Not implemented");