mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03:32:13 +00:00
feat: adjustment update achievements on api
This commit is contained in:
parent
333b143b17
commit
a48e269d7f
2 changed files with 12 additions and 5 deletions
|
@ -67,7 +67,7 @@ const getGameAchievements = async (
|
||||||
return {
|
return {
|
||||||
...achievement,
|
...achievement,
|
||||||
unlocked: true,
|
unlocked: true,
|
||||||
unlockTime: unlockedAchiement.unlockTime * 1000,
|
unlockTime: unlockedAchiement.unlockTime,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,11 +41,18 @@ export const mergeAchievements = async (
|
||||||
localGameAchievement?.unlockedAchievements || "[]"
|
localGameAchievement?.unlockedAchievements || "[]"
|
||||||
);
|
);
|
||||||
|
|
||||||
const newAchievements = achievements.filter((achievement) => {
|
const newAchievements = achievements
|
||||||
return !unlockedAchievements.some((localAchievement) => {
|
.filter((achievement) => {
|
||||||
return localAchievement.name === achievement.name;
|
return !unlockedAchievements.some((localAchievement) => {
|
||||||
|
return localAchievement.name === achievement.name;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.map((achievement) => {
|
||||||
|
return {
|
||||||
|
...achievement,
|
||||||
|
unlockTime: achievement.unlockTime * 1000,
|
||||||
|
};
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
if (newAchievements.length) {
|
if (newAchievements.length) {
|
||||||
const achievement = newAchievements.at(-1)!;
|
const achievement = newAchievements.at(-1)!;
|
||||||
|
|
Loading…
Reference in a new issue