feat: refactoring achievements watcher

This commit is contained in:
Zamitto 2024-10-01 22:21:41 -03:00
parent c18c41ac95
commit 44e59a5f6f
12 changed files with 120 additions and 57 deletions

View file

@ -179,8 +179,6 @@ export function GameDetailsContextProvider({
}, [game?.id, isGameRunning, updateGame]);
useEffect(() => {
window.electron.updateGameUnlockedAchievements(objectID!).catch(() => {});
const unsubscribe = window.electron.onAchievementUnlocked(
(objectId, shop) => {
if (objectID !== objectId || shop !== shop) return;

View file

@ -70,7 +70,6 @@ declare global {
objectId: string,
shop: GameShop
) => Promise<GameAchievement[]>;
updateGameUnlockedAchievements: (objectId: string) => Promise<void>;
onAchievementUnlocked: (
cb: (
objectId: string,