feat: grayscale and update game details context on achievement event

This commit is contained in:
Zamitto 2024-09-26 17:37:07 -03:00
parent 50b34dc864
commit 54dae87a58
7 changed files with 43 additions and 1 deletions

View file

@ -1,6 +1,7 @@
import { gameAchievementRepository, gameRepository } from "@main/repository";
import { publishNewAchievementNotification } from "../notifications";
import type { GameShop, UnlockedAchievement } from "@types";
import { WindowManager } from "../window-manager";
export const mergeAchievements = async (
objectId: string,
@ -28,6 +29,14 @@ export const mergeAchievements = async (
});
});
if (!newAchievements.length) return;
WindowManager.mainWindow?.webContents.send(
"on-achievement-unlocked",
objectId,
shop
);
for (const achievement of newAchievements) {
const completeAchievement = JSON.parse(
localGameAchievement?.achievements || "[]"