fix: reset lastPacket on signout

This commit is contained in:
Zamitto
2025-02-02 20:15:27 -03:00
parent 2e85363966
commit 34e439bd66
12 changed files with 34 additions and 28 deletions

View File

@@ -46,9 +46,9 @@ const addGameToLibrary = async (
await gamesSublevel.put(levelKeys.game(shop, objectId), game);
updateLocalUnlockedAchivements(game!);
updateLocalUnlockedAchivements(game);
createGame(game!).catch(() => {});
createGame(game).catch(() => {});
}
};

View File

@@ -1,3 +1,2 @@
export { db } from "./level";
export * from "./sublevels";

View File

@@ -2,5 +2,4 @@ export * from "./downloads";
export * from "./games";
export * from "./game-shop-cache";
export * from "./game-achievements";
export * from "./keys";

View File

@@ -234,6 +234,8 @@ export class DownloadManager {
});
WindowManager.mainWindow?.setProgressBar(-1);
WindowManager.mainWindow?.webContents.send("on-download-progress", null);
if (downloadKey === this.downloadingGameId) {
this.downloadingGameId = null;
}

View File

@@ -35,22 +35,20 @@ export const mergeWithRemoteGames = async () => {
name: "getById",
});
if (steamGame) {
const iconUrl = steamGame?.clientIcon
? steamUrlBuilder.icon(game.objectId, steamGame.clientIcon)
: null;
const iconUrl = steamGame?.clientIcon
? steamUrlBuilder.icon(game.objectId, steamGame.clientIcon)
: null;
gamesSublevel.put(levelKeys.game(game.shop, game.objectId), {
objectId: game.objectId,
title: steamGame?.name,
remoteId: game.id,
shop: game.shop,
iconUrl,
lastTimePlayed: game.lastTimePlayed,
playTimeInMilliseconds: game.playTimeInMilliseconds,
isDeleted: false,
});
}
gamesSublevel.put(levelKeys.game(game.shop, game.objectId), {
objectId: game.objectId,
title: steamGame?.name,
remoteId: game.id,
shop: game.shop,
iconUrl,
lastTimePlayed: game.lastTimePlayed,
playTimeInMilliseconds: game.playTimeInMilliseconds,
isDeleted: false,
});
}
}
})

View File

@@ -21,11 +21,18 @@ export const getSteamAppDetails = async (
});
return axios
.get(
.get<SteamAppDetailsResponse>(
`http://store.steampowered.com/api/appdetails?${searchParams.toString()}`
)
.then((response) => {
if (response.data[objectId].success) return response.data[objectId].data;
if (response.data[objectId].success) {
const data = response.data[objectId].data;
return {
...data,
objectId,
};
}
return null;
})
.catch((err) => {