feat: start watching new achievements only after finishing sync

This commit is contained in:
Zamitto 2024-10-21 01:48:47 -03:00
parent bb65d77fc6
commit c6fda9b4d8
4 changed files with 109 additions and 98 deletions

View file

@ -4,7 +4,7 @@ import { IsNull } from "typeorm";
import { HydraApi } from "../hydra-api";
import { mergeWithRemoteGames } from "./merge-with-remote-games";
import { WindowManager } from "../window-manager";
import { updateAllLocalUnlockedAchievements } from "../achievements/update-local-unlocked-achivements";
import { AchievementWatcherManager } from "../achievements/AchievementWatcherManager";
export const uploadGamesBatch = async () => {
const games = await gameRepository.find({
@ -29,7 +29,7 @@ export const uploadGamesBatch = async () => {
await mergeWithRemoteGames();
await updateAllLocalUnlockedAchievements();
await AchievementWatcherManager.preSearchAchievements();
if (WindowManager.mainWindow)
WindowManager.mainWindow.webContents.send("on-library-batch-complete");