mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-17 16:33:55 +00:00
fix: refactor and fix types
This commit is contained in:
@@ -14,9 +14,13 @@ const syncGameByObjectId = async (
|
||||
const gameKey = levelKeys.game(shop, objectId);
|
||||
const game = await gamesSublevel.get(gameKey);
|
||||
|
||||
const { id, playTimeInSeconds, ...rest } = res;
|
||||
|
||||
gamesSublevel.put(gameKey, {
|
||||
...(game ?? { remoteId: null }),
|
||||
...res,
|
||||
...game,
|
||||
...rest,
|
||||
remoteId: id,
|
||||
playTimeInMilliseconds: playTimeInSeconds * 1000,
|
||||
});
|
||||
|
||||
return res;
|
||||
|
||||
@@ -344,8 +344,8 @@ export type LibraryGame = Game &
|
||||
};
|
||||
|
||||
export type UserGameDetails = ShopAssets & {
|
||||
userId: string;
|
||||
playTimeInMilliseconds: number;
|
||||
id: string;
|
||||
playTimeInSeconds: number;
|
||||
unlockedAchievementCount: number;
|
||||
achievementsPointsEarnedSum: number;
|
||||
lastTimePlayed: Date | null;
|
||||
|
||||
Reference in New Issue
Block a user