Merge branch 'main' into feat/HYD-858

This commit is contained in:
Chubby Granny Chaser
2025-05-30 14:15:59 +01:00
committed by GitHub
8 changed files with 27 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ type ProfileGame = {
id: string;
lastTimePlayed: Date | null;
playTimeInMilliseconds: number;
isFavorite?: boolean;
} & ShopAssets;
export const mergeWithRemoteGames = async () => {
@@ -34,6 +35,7 @@ export const mergeWithRemoteGames = async () => {
remoteId: game.id,
lastTimePlayed: updatedLastTimePlayed,
playTimeInMilliseconds: updatedPlayTime,
favorite: game.isFavorite ?? localGame.favorite,
});
} else {
await gamesSublevel.put(levelKeys.game(game.shop, game.objectId), {
@@ -45,6 +47,7 @@ export const mergeWithRemoteGames = async () => {
lastTimePlayed: game.lastTimePlayed,
playTimeInMilliseconds: game.playTimeInMilliseconds,
isDeleted: false,
favorite: game.isFavorite ?? false,
});
}

View File

@@ -26,6 +26,7 @@ export const uploadGamesBatch = async () => {
playTimeInMilliseconds: Math.trunc(game.playTimeInMilliseconds),
shop: game.shop,
lastTimePlayed: game.lastTimePlayed,
isFavorite: game.favorite,
};
})
).catch(() => {});