feat: pinning and showing featuring games in profile

This commit is contained in:
Moyasee
2025-09-23 15:21:32 +03:00
parent 2604dfea22
commit 33c15baf0e
15 changed files with 192 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ type ProfileGame = {
playTimeInMilliseconds: number;
hasManuallyUpdatedPlaytime: boolean;
isFavorite?: boolean;
isPinned?: boolean;
} & ShopAssets;
export const mergeWithRemoteGames = async () => {
@@ -36,6 +37,7 @@ export const mergeWithRemoteGames = async () => {
lastTimePlayed: updatedLastTimePlayed,
playTimeInMilliseconds: updatedPlayTime,
favorite: game.isFavorite ?? localGame.favorite,
pinned: game.isPinned ?? localGame.pinned,
});
} else {
await gamesSublevel.put(gameKey, {
@@ -49,6 +51,7 @@ export const mergeWithRemoteGames = async () => {
hasManuallyUpdatedPlaytime: game.hasManuallyUpdatedPlaytime,
isDeleted: false,
favorite: game.isFavorite ?? false,
pinned: game.isPinned ?? false,
});
}

View File

@@ -27,6 +27,7 @@ export const uploadGamesBatch = async () => {
shop: game.shop,
lastTimePlayed: game.lastTimePlayed,
isFavorite: game.favorite,
isPinned: game.pinned ?? false,
};
})
).catch(() => {});