feat: refactor

This commit is contained in:
Zamitto 2024-07-02 15:42:23 -03:00
parent c9c585f820
commit b8bd786c45
2 changed files with 69 additions and 71 deletions

View File

@ -4,10 +4,9 @@ import { steamGamesWorker } from "@main/workers";
import { getSteamAppAsset } from "@main/helpers";
export const mergeWithRemoteGames = async () => {
try {
const games = await HydraApi.get("/games");
for (const game of games.data) {
return HydraApi.get("/games")
.then(async (response) => {
for (const game of response.data) {
const localGame = await gameRepository.findOne({
where: {
objectID: game.objectId,
@ -60,5 +59,6 @@ export const mergeWithRemoteGames = async () => {
}
}
}
} catch (err) {}
})
.catch();
};

View File

@ -6,7 +6,6 @@ import { mergeWithRemoteGames } from "./merge-with-remote-games";
import { WindowManager } from "../window-manager";
export const uploadGamesBatch = async () => {
try {
const games = await gameRepository.find({
where: { remoteId: IsNull(), isDeleted: false },
});
@ -31,5 +30,4 @@ export const uploadGamesBatch = async () => {
if (WindowManager.mainWindow)
WindowManager.mainWindow.webContents.send("on-library-batch-complete");
} catch (err) {}
};