mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-23 19:01:02 +00:00
feat: small refactor
This commit is contained in:
@@ -142,10 +142,10 @@ const processAchievementFileDiff = async (
|
||||
game: Game,
|
||||
file: AchievementFile
|
||||
) => {
|
||||
const unlockedAchievements = parseAchievementFile(file.filePath, file.type);
|
||||
console.log("achievements length", unlockedAchievements.length);
|
||||
if (unlockedAchievements.length) {
|
||||
return mergeAchievements(game, unlockedAchievements, true);
|
||||
const parsedAchievements = parseAchievementFile(file.filePath, file.type);
|
||||
|
||||
if (parsedAchievements.length) {
|
||||
return mergeAchievements(game, parsedAchievements, true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -135,6 +135,12 @@ export const mergeAchievements = async (
|
||||
};
|
||||
});
|
||||
|
||||
achievementsLogger.log(
|
||||
"Publishing achievement notification",
|
||||
game.objectId,
|
||||
game.title
|
||||
);
|
||||
|
||||
if (userPreferences.achievementCustomNotificationsEnabled !== false) {
|
||||
WindowManager.notificationWindow?.webContents.send(
|
||||
"on-achievement-unlocked",
|
||||
|
||||
@@ -34,9 +34,7 @@ export const uploadGamesBatch = async () => {
|
||||
|
||||
await mergeWithRemoteGames();
|
||||
|
||||
if (HydraApi.isLoggedIn()) {
|
||||
AchievementWatcherManager.preSearchAchievements();
|
||||
}
|
||||
AchievementWatcherManager.preSearchAchievements();
|
||||
|
||||
if (WindowManager.mainWindow)
|
||||
WindowManager.mainWindow.webContents.send("on-library-batch-complete");
|
||||
|
||||
@@ -112,8 +112,6 @@ export interface UserFriend {
|
||||
id: string;
|
||||
displayName: string;
|
||||
profileImageUrl: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
currentGame:
|
||||
| (ShopAssets & {
|
||||
sessionDurationInSeconds: number;
|
||||
@@ -146,8 +144,6 @@ export interface UserRelation {
|
||||
AId: string;
|
||||
BId: string;
|
||||
status: "ACCEPTED" | "PENDING";
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type UserProfileCurrentGame = GameRunning &
|
||||
@@ -330,8 +326,6 @@ export type CatalogueSearchResult = {
|
||||
genres: string[];
|
||||
objectId: string;
|
||||
shop: GameShop;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
title: string;
|
||||
installCount: number;
|
||||
achievementCount: number;
|
||||
|
||||
Reference in New Issue
Block a user