mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
feat: adjustments
This commit is contained in:
parent
a48e269d7f
commit
a031049b73
@ -9,13 +9,9 @@ export const getGameAchievementData = async (
|
|||||||
where: { id: 1 },
|
where: { id: 1 },
|
||||||
});
|
});
|
||||||
|
|
||||||
return HydraApi.get(
|
return HydraApi.get("/games/achievements", {
|
||||||
"/games/achievements",
|
shop,
|
||||||
{
|
objectId,
|
||||||
shop,
|
language: userPreferences?.language || "en",
|
||||||
objectId,
|
});
|
||||||
language: userPreferences?.language || "en",
|
|
||||||
},
|
|
||||||
{ needsAuth: false }
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
@ -8,14 +8,22 @@ const saveAchievementsOnLocal = async (
|
|||||||
shop: string,
|
shop: string,
|
||||||
achievements: any[]
|
achievements: any[]
|
||||||
) => {
|
) => {
|
||||||
return gameAchievementRepository.upsert(
|
return gameAchievementRepository
|
||||||
{
|
.upsert(
|
||||||
objectId,
|
{
|
||||||
shop,
|
objectId,
|
||||||
unlockedAchievements: JSON.stringify(achievements),
|
shop,
|
||||||
},
|
unlockedAchievements: JSON.stringify(achievements),
|
||||||
["objectId", "shop"]
|
},
|
||||||
);
|
["objectId", "shop"]
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
WindowManager.mainWindow?.webContents.send(
|
||||||
|
"on-achievement-unlocked",
|
||||||
|
objectId,
|
||||||
|
shop
|
||||||
|
);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const mergeAchievements = async (
|
export const mergeAchievements = async (
|
||||||
@ -62,14 +70,6 @@ export const mergeAchievements = async (
|
|||||||
return achievement.name === steamAchievement.name;
|
return achievement.name === steamAchievement.name;
|
||||||
});
|
});
|
||||||
|
|
||||||
WindowManager.mainWindow?.webContents.send(
|
|
||||||
"on-achievement-unlocked",
|
|
||||||
objectId,
|
|
||||||
shop,
|
|
||||||
achievementInfo.displayName,
|
|
||||||
achievementInfo.icon
|
|
||||||
);
|
|
||||||
|
|
||||||
if (publishNotification) {
|
if (publishNotification) {
|
||||||
WindowManager.notificationWindow?.webContents.send(
|
WindowManager.notificationWindow?.webContents.send(
|
||||||
"on-achievement-unlocked",
|
"on-achievement-unlocked",
|
||||||
|
@ -42,7 +42,7 @@ export const updateLocalUnlockedAchivements = async (
|
|||||||
["objectId", "shop"]
|
["objectId", "shop"]
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch(console.log);
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
const unlockedAchievements: UnlockedAchievement[] = [];
|
const unlockedAchievements: UnlockedAchievement[] = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user